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