Last active
August 29, 2015 14:27
-
-
Save gabro/c2188b2f6f1d01108124 to your computer and use it in GitHub Desktop.
UIViewController producing values. Example of editing a profile section with a modal interaction, which can produce a new Patient
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a ViewController automatically wrapped in a UINavigationController | |
// returns the viewController and a Signal<Patient, NoError> | |
let (profileVC, signal) = EditPersonalInfoViewController.wrappedInNavigationController(patient: patient) | |
// observe the signal. When a new Patient is produced, update the view | |
// dismiss the view controller whenever the signal is completed (i.e. modifications have been saved or interaction has been canceled) | |
signal.observe(next: reloadViewForPatient, completed: dismissViewController) | |
// let the game being | |
self.presentViewController(profileVC, animated: true, completion: nil) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment