Last active
August 29, 2015 13:59
-
-
Save modocache/10565279 to your computer and use it in GitHub Desktop.
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
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { | |
if ([segue.identifier isEqualToString:@"user"]) { | |
// Type casts? I thought we were using a static language here?! | |
UserViewController *userViewController = (UserViewController *)segue.destinationViewController; | |
// I have to expose a property in order to configure the view controller. | |
// The view controller is in an invalid state prior to this assignment. | |
userViewController.user = self.selectedUser; | |
[self.navigationController pushViewController:userViewController animated:YES]; | |
} else if ([segue.identifier isEqualToString:@"settings"]) { | |
// More of the same boilerplate... | |
SettingsViewController *settingsViewController = (SettingsViewController *)segue.destinationViewController; | |
settingsViewController.user = self.selectedUser; | |
settingsViewController.editable = self.loggedIn; | |
[self.navigationController presentViewController:settingsViewController animated:YES completion:nil]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment