Ultimate Guide to Writing Parent View Controllers

Short version

If I write my own controller with a split view, what do I need to do to get the child view controllers to work properly?

For example: send viewWillAppear:, etc.

Long version

Background

And back, I answered the following question:
Switching between UIViewControllers using UISegmentedControl

With the following answer:

The right way to do this is to force the controller to process the UISegmentedControladdition of controller representations in the form of subzones.

[self.view addSubview:controller.view];

It is your responsibility to send viewWillAppear:, etc.

However, tc. pointed out that this is not as trivial as it seems:

. View - UIViewController, ( -view {Will, Did} {Appear, Disappear}: and -shouldRotateToViewOritentation:).

"" , UIKit . --parentViewController ( , modal view controller). , - UIKit -viewSomethingSomething: , -viewDidDisappear: ! ( , , , , , call -viewWillAppear: .) , Apple "" .

, , , . Apple , Google , stackoverflow.

, , , , .

+3
1

, " ". , , UIViewController, API, UIViewController ? "" UIViewController.

, parentViewController, splitViewController, navigationController, tabBarController interfaceOrientation (, , modalViewController). , , UIKit, - , , , UIViewController ivars , .

, UIKit , UIViewController , , , , .

, , Apple. , , parentViewController, navigationController, tabBarController splitViewController nil?

, iOS.

+1

All Articles