Skip to content

Instantly share code, notes, and snippets.

@MengTo
Last active December 30, 2015 21:28
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 MengTo/7887238 to your computer and use it in GitHub Desktop.
Save MengTo/7887238 to your computer and use it in GitHub Desktop.
Send Data from ViewController to ContainerViewController through Segue's Identifier
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([[segue identifier] isEqualToString:@"dialogScene"]) {
self.data = 1;
ViewController *controller = [segue destinationViewController];
controller.data = self.data;
}
}
// In destinationViewController.h
@property (nonatomic, strong) NSDictionary *data;
// If there is a Navigation Controller in Between
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:@"preBookingScene"]) {
UINavigationController *navController = segue.destinationViewController;
CSDialogViewController *controller = [navController viewControllers][0];
controller.data = self.data;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment