I use a UINavigationController with several viewcontrollers. One of the viewcontrollers, which is constructed programmatically in loadview:
, does some custom animations to do a transition from the previous viewcontroller.
So these animations should only happen when the viewcontroller is pushed, since loadview is only called once when creating the viewcontroller before the push, this usually all works perfectly fine.
However when some other viewcontrollers get pushed, and memory gets tight, the view gets unloaded automatically by the system and reconstructed if it appears again after the other viewcontrollers are popped.
Naturally I don't want the transistion animation to occur, as they look rather weird if they don't follow a push on the previous viewcontroller.
I could probably keep some state info, or send notifications, myself to know if the loadview is called because of a pushViewController or a popViewController, but I wondered if there's any built in way to know if a loadView happens because the view is constructed the first time, or because it was previously purged?