Skip to content

Instantly share code, notes, and snippets.

@akitsukada
Last active August 29, 2015 14:02
Show Gist options
  • Save akitsukada/90053b2f3d32f24bdf81 to your computer and use it in GitHub Desktop.
Save akitsukada/90053b2f3d32f24bdf81 to your computer and use it in GitHub Desktop.
Segue usage
/**
* よくある Segue のサンプルコード
*/
- (void)hoge {
// Storyboard で設定した Segue を文字列で指定して実行
[self performSegueWithIdentifier:@"next" sender:self];
}
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// どの Segue が実行されているのか、Segue の ID を文字列で判定して処理
if ( [[segue identifier] isEqualToString:@"next"] ) {
UIViewController *nextViewController = [segue destinationViewController];
nextViewController.hogeProperty = @"HOGEHOGE";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment