diff --git a/SwiftNotice.swift b/SwiftNotice.swift index 9cd8398..aaf76e1 100644 --- a/SwiftNotice.swift +++ b/SwiftNotice.swift @@ -59,6 +59,8 @@ class SwiftNotice: NSObject { static var windows = Array() static let rv = UIApplication.sharedApplication().keyWindow?.subviews.first as UIView! + // fix https://github.com/johnlui/SwiftNotice/issues/2 + // thanks broccolii(https://github.com/broccolii) and his PR https://github.com/johnlui/SwiftNotice/pull/5 static func clear() { self.cancelPreviousPerformRequestsWithTarget(self) windows.removeAll(keepCapacity: false) @@ -185,6 +187,7 @@ class SwiftNotice: NSObject { } } + // fix https://github.com/johnlui/SwiftNotice/issues/2 static func hideNotice(sender: AnyObject) { if let window = sender as? UIWindow { if let index = windows.indexOf({ (item) -> Bool in diff --git a/SwiftNoticeExample/SwiftNoticeExample.xcodeproj/project.xcworkspace/xcuserdata/leqicheng.xcuserdatad/UserInterfaceState.xcuserstate b/SwiftNoticeExample/SwiftNoticeExample.xcodeproj/project.xcworkspace/xcuserdata/leqicheng.xcuserdatad/UserInterfaceState.xcuserstate index 2ec1b7d..4b745a0 100644 Binary files a/SwiftNoticeExample/SwiftNoticeExample.xcodeproj/project.xcworkspace/xcuserdata/leqicheng.xcuserdatad/UserInterfaceState.xcuserstate and b/SwiftNoticeExample/SwiftNoticeExample.xcodeproj/project.xcworkspace/xcuserdata/leqicheng.xcuserdatad/UserInterfaceState.xcuserstate differ