Skip to content

Instantly share code, notes, and snippets.

@njdehoog
Created November 5, 2014 16:20
Show Gist options
  • Save njdehoog/b881e127b17f4d4c03fe to your computer and use it in GitHub Desktop.
Save njdehoog/b881e127b17f4d4c03fe to your computer and use it in GitHub Desktop.
class Person {
var name = Observable("John")
}
let person = Person()
person.name.subscribe() { oldValue, newValue in
println("name changed: \(oldValue) to \(newValue)")
}
person.name.value = "Jane"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment