Skip to content

Instantly share code, notes, and snippets.

@Qiki
Qiki / Using segue in ViewController
Last active December 26, 2015 09:29
Using Segue in ViewController
//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