Created
January 5, 2016 12:12
-
-
Save robertjpayne/6ca07f26a8da6053148f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let _name = Observable<String>("Hello") | |
var name: ObservableOf<String> { | |
return ObservableOf(self._name) | |
} | |
var scope: NSString? = "Yeehaw" | |
self.name.observe { (oldValue, newValue) -> Void in | |
print("\(oldValue) => \(newValue)") | |
}.scopeTo(scope!) | |
self._name.value = "Payne" | |
scope = nil | |
self._name.value = "Scope was deallocd so this wont be called" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment