Skip to content

Instantly share code, notes, and snippets.

@azamsharp
Created October 22, 2017 03:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save azamsharp/2232e81e064a67ac7070580db87ec6f1 to your computer and use it in GitHub Desktop.
Save azamsharp/2232e81e064a67ac7070580db87ec6f1 to your computer and use it in GitHub Desktop.
import Foundation
class Dynamic<T> {
var bind :(T) -> () = { _ in }
var value :T? {
didSet {
bind(value!)
}
}
init(_ v :T) {
value = v
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment