Parent/child view controllers: when shall we use it?
Parent/child view controllers: when shall we use it?
- Subject: Parent/child view controllers: when shall we use it?
- From: Colas B <email@hidden>
- Date: Thu, 30 Apr 2015 20:54:20 +0000 (UTC)
Dear cocoa-dev,
When building a simple UIViewController, do I have to use addChildViewController: if this VC "owns" other VCs?(By simple VC, I mean I am not creating MyCustomNavigationController or something like that; just a "plain old" VC)
Imagine for example that I build a view controller (MyCustomVC) and its view has a small subview (fbView) for a Facebook logo and a counter. This "facebook view" is attached to a view controller (FacebookVC) that is called when fbView is touched. So, the FacebookVC definitely needs to be a @property of the MyCustomVC.In this situation, should I really use addChildViewController: and all the mechanism to declare FacebookVC to be a childController of MyCustomVC?
My belief is that: NO, in this situation it is not to be use. IMHO, MyCustomVC is NOT a container view controller and the usage of child/parent mechanism is only for UINavigationController, TabBar, ... or if I want to create such a "general" class.
So, am I wrong or am I right ?
Thanks ;-)Colas
_______________________________________________
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