Skip to content

Instantly share code, notes, and snippets.

@jkereako
Forked from azamsharp/dynamic.swift
Created November 28, 2017 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkereako/315aa83ac3f1e5abfcdc862a8ce06c73 to your computer and use it in GitHub Desktop.
Save jkereako/315aa83ac3f1e5abfcdc862a8ce06c73 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