ViewWillAppear not being called on main view UISplitViewController
I have a splitvew controller (set in storyboard) with master and details and I set preferredDisplayMode as UISplitViewControllerDisplayModeAllVisible
in master viewController.
I have this method on my main view controller:
- (void) viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
//This is called
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
//This is not called
[self.searchController.searchBar sizeToFit];
[self configNavBar]; //Adds few buttons to the nav bar
}
I am wondering why viewwillAppear
viewDidLoad, viewDidAppear are not called here but are called. A breakpoint was not hit in viewWillAppear.
If I set my preferred display mode to UISplitViewControllerDisplayModePrimaryOverlay
then viewWillAppear will be called. But here, the detail view controller doesn't take up half the screen.
source to share
No one has answered this question yet
Check out similar questions: