presentViewController completion block usage
presentViewController completion block usage
- Subject: presentViewController completion block usage
- From: Koen van der Drift <email@hidden>
- Date: Fri, 12 Apr 2013 08:50:20 -0400
When a modal UIViewController is dismissed, Apple recommends to use the delegate pattern to pass data back to the presenting UIViewController. I am using that and it works just fine. But I was wondering if the same (passing data back) can be achieved using the completion block. Right now, I just set it to nil when showing and dismissing the modalVC:
[self presentViewController: modalVC animated: YES completion: nil];
and
[[self presentingViewController] dismissViewControllerAnimated: YES completion: nil];
But even though it is often set to nil, that completion argument isn't there for no reason. So, can it be used to pass values of settings back and forward between the presentingVC and the modalVC? Or is that a misuse of the completion block? And if so, what would be a use of the completion block when presenting and dismissing view controllers?
Thanks,
- Koen.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden