• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
presentViewController completion block usage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: presentViewController completion block usage
      • From: Roland King <email@hidden>
  • Prev by Date: Re: Passing NSTextField Pointer to IOUSBInterfaceInterface182 Callback
  • Next by Date: Re: presentViewController completion block usage
  • Previous by thread: Problem with NSViewAnimation
  • Next by thread: Re: presentViewController completion block usage
  • Index(es):
    • Date
    • Thread