Skip to content

Instantly share code, notes, and snippets.

@keicoder
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save keicoder/9017302 to your computer and use it in GitHub Desktop.

Select an option

Save keicoder/9017302 to your computer and use it in GitHub Desktop.
objective-c : presentView and dismissView method with block
//presentView and dismissView method with block
NSLog(@"Presenting view");
[self presentViewController:changeLocationViewController animated:YES completion:^{
NSLog(@"View done presenting");
}];
NSLog(@"Dismissing view");
[self dismissViewControllerAnimated:NO completion:^{
NSLog(@"View done dismissing");
}];
//ex
- (IBAction)doneButtonPressed:(id)sender {
if (debug==1) {NSLog(@"Running %@ '%@'", self.class, NSStringFromSelector(_cmd));}
[self dismissViewControllerAnimated:YES completion:^{
NSLog(@"Dismissing View");
NSLog(@"View done dismissing");
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment