Re: Parent/child view controllers: when shall we use it?
Re: Parent/child view controllers: when shall we use it?
- Subject: Re: Parent/child view controllers: when shall we use it?
- From: Colas <email@hidden>
- Date: Mon, 04 May 2015 14:21:12 +0200
Thanks Roland for your answer. Sorry for the unclarity of my question.
You completely answered my question.
I wondered about this point because I come from the OSX development and there is not (as far as I know) this concept of child/parent.
Colas
Le 1 mai 2015 à 06:47, email@hidden a écrit :
> Had some difficulty completing understanding what you’re trying to do here but I think you’re not right in this instance.
>
> I’ll try putting it another way. If you have a view controller and its view contains subviews which are the views of a different view controller, then you must use the addChildViewController and other methods to make a correct hierarchy of view controllers. Any use of another view controller’s view in your view controller’s view requires that you set up (and tear down) the view controller parent child relationship. if you don’t, rotation won’t work, the view appearance/disappearance methods won’t work and various other methods passed down from view controller to view controller won’t work.
>
> So in your case it seems like your MyCustomVC’s view has, as subview, a fbView which is the ‘view’ of a FacebookVC. Before you add that view to your MyCustomVC’s view’s hierarchy you must make the FacebookVC a child of your MyCustomVC.
>
> TL;DR; If your VC’s view embeds a view from another VC, you must set up a parent-child relationship between the VCs
_______________________________________________
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