UIKit.UIViewController.BeginAppearanceTransition Method
With UIViewController.EndAppearanceTransition, tells child UIKit.UIViewControllers that their UIKit.UIViews are about to either appear or disappear.

Syntax

[Foundation.Export("beginAppearanceTransition:animated:")]
[ObjCRuntime.Availability(Introduced=ObjCRuntime.Platform.iOS_5_0)]
public virtual void BeginAppearanceTransition (bool isAppearing, bool animated)

See Also

UIViewController.EndAppearanceTransition

Parameters

isAppearing
true if the child UIKit.UIViewController’s views are being shown, false if they are being hidden.
animated
true if the transition is being animated.

Remarks

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

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

C# Example

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

Related content

Requirements

Namespace: UIKit
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0