Last active
December 26, 2015 09:29
-
-
Save Qiki/7130103 to your computer and use it in GitHub Desktop.
Using Segue in ViewController
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
//call the segue to put the data you want to transfer | |
- (IBAction)click{ | |
[self performSegueWithIdentifier:@"PUSH_NEXT" | |
sender:[NSDictionary dictionaryWithObjectsAndKeys: | |
self.page.data,@"data",nil]]; | |
} | |
//prepareForSegue - tranfer the data to next viewController and push to the next view controller | |
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { | |
if ([[segue identifier] isEqualToString:@"PUSH_NEXT"]) { | |
NextPageViewController *vc = [segue destinationViewController]; //set destination view controller | |
vc.data = [sender objectForKey:@"data"]; //tranfer the data in the current view controller into next view controller,need to set the property in next page first | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment