Before resorting to custom flags I wanted to check this with you people.
Is there a built-in way to determine in viewWillAppear:
or viewWillDisappear:
whether the UIViewController is 'newly pushed' onto a UINavigationController's stack, or whether the navigation controller has popped another view off, revealing this one? I want to execute some one-off code the first time the view appears. Because the self.bounds
property needs to be set, the viewDidLoad:
method is not the right place.
I was hoping to get some results with what I'm using to determine something similar on viewWillDisappear:
, but on the first viewWillAppear:
the index is already set to 1:
[self.navigationController.viewControllers indexOfObject:self]
So this is a useless snippet. Any ideas?