Last active
August 29, 2015 14:02
-
-
Save akitsukada/90053b2f3d32f24bdf81 to your computer and use it in GitHub Desktop.
Segue usage
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
/** | |
* よくある 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