SimpleReactive is my experiment for demonstrate reactive programming.
@IBOutlet weak var value2Display: UILabel!
@IBOutlet weak var value2Display2: UILabel!
let singal = SimpleColdSignal("")
override func viewDidLoad() {
super.viewDidLoad()
singal.bindTo(label: value2Display)
singal.bindTo(label: value2Display2)
}
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
let nsString = textField.text as NSString?
let newString = nsString?.replacingCharacters(in: range, with: string)
singal.next(newString ?? "")
return true
}
To run the example project, clone the repo, and run pod install
from the Example directory first.
SimpleReactive is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "SimpleReactive"
SimpleReactive is available under the MIT license. See the LICENSE file for more info.