Closed tokorom closed 9 years ago
Sorry, but your change would allow a NotificationListener
with no target to be triggered no matter the target. Listener
s with no target
have a targetID
equal to an empty string. If the NSNotification.object
is equal to nil, hashify
will return an empty string, thus working as expected.
You need to be using the UIApplication
instance as the target for things to work correctly.
let didBecomeActive = Notification(UIApplicationDidBecomeActiveNotification)
didBecomeActive.once(UIApplication.sharedApplication()) {
println("UIApplication became active: \($0)")
}
Thank you for reply :)
I understand it.
:+1:
Before
UIApplicationDidBecomeActiveNotification
andUIApplicationWillEnterForegroundNotification
and others.After