Skip to content

Instantly share code, notes, and snippets.

@sjmadsen
Created January 22, 2016 14:10
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 sjmadsen/858f37d32741c98b3530 to your computer and use it in GitHub Desktop.
Save sjmadsen/858f37d32741c98b3530 to your computer and use it in GitHub Desktop.
ReactiveCocoa snippet
textField1.rac_textSignal().toSignalProducer()
.combineLatestWith(textField2.rac_textSignal().toSignalProducer())
.map { ($0.0 as! String, $0.1 as! String) }
.startWithNext { (first, second) in
self.saveButton.enabled = (first.characters.count + second.characters.count) > 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment