UIViewController.BeginAppearanceTransition(Boolean, Boolean) Method


With EndAppearanceTransition(), tells child UIViewControllers that their UIViews are about to either appear or disappear.

public virtual void BeginAppearanceTransition (bool isAppearing, bool animated);
abstract member BeginAppearanceTransition : bool * bool -> unit
override this.BeginAppearanceTransition : bool * bool -> unit



true if the child UIViewController’s views are being shown, false if they are being hidden.


true if the transition is being animated.



This method, along with EndAppearanceTransition(), should be used to alert child UIViewControllers that their view or views are about to be shown or hidden. The application developer must invoke these methods and must not call ViewWillAppear(Boolean), ViewDidAppear(Boolean), ViewWillDisappear(Boolean), or ViewDidDisappear(Boolean) directly.

The following code, from the "Media Notes" sample, demonstrates the use of BeginAppearanceTransition(Boolean, Boolean) and EndAppearanceTransition(). The code snippet shows the child UIViewController being removed from the display (isAppearing is false) in an animated mirror (animated is true). The call to BeginAppearanceTransition(Boolean, Boolean) occurs and then EndAppearanceTransition() is called at the end of the specified animation.

commentViewIsVisible = false;
commentViewController.WillMoveToParentViewController (null);
commentViewController.BeginAppearanceTransition (false, true);
UIView.Animate (0.5f, () => {
    commentView.Alpha = 0.5f;
}, () => { 
    commentView.RemoveFromSuperview ();
    commentViewController.EndAppearanceTransition ();
    commentViewController.RemoveFromParentViewController ();

Applies to

See also