isMovingFromParentViewController / isMovingToParentViewController :适应于container 和 content viewcontroller 之间。例如:addChildViewController方法,navigationController 中的push 和pop。
isBeingPresented / isBeingDismissed :适应于present 和 presented viewcontroller 之间。presentViewController: animated: completion方法。
【官方资料】
Determining Why a View’s Appearance Changed
Occasionally, it can be useful to know why a view is appearing or disappearing. For example, you might want to know whether a view appeared because it was just added to a container or whether it appeared because some other content that obscured it was removed. This particular example often appears when using navigation controllers; your content controller’s view may appear because the view controller was just pushed onto the navigation stack or it might appear because controllers previously above it were popped from the stack.
The UIViewController
isBeingPresented / isBeingDismissed :适应于present 和 presented viewcontroller 之间。presentViewController: animated: completion方法。
【官方资料】
Determining Why a View’s Appearance Changed
Occasionally, it can be useful to know why a view is appearing or disappearing. For example, you might want to know whether a view appeared because it was just added to a container or whether it appeared because some other content that obscured it was removed. This particular example often appears when using navigation controllers; your content controller’s view may appear because the view controller was just pushed onto the navigation stack or it might appear because controllers previously above it were popped from the stack.
The UIViewController