Skip to content

Instantly share code, notes, and snippets.

@akuraru
Created December 3, 2013 08:10
Show Gist options
  • Save akuraru/7765683 to your computer and use it in GitHub Desktop.
Save akuraru/7765683 to your computer and use it in GitHub Desktop.
segueのidをいちいち比較するのが面倒なので、最近はこんな感じで書いてたりする。senderがBlocks以外だったらどうするか?知りませんよそんなの
- (IBAction)touchMove:(id)sender {
__weak typeof (self) this = self;
[self performSegueWithIdentifier:kSeguePicture sender:^(id controller) {
[controller setViewObject:this.viewObject];
}];
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(void (^)(id))sender {
if (sender) {
sender(segue.destinationViewController);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment