UIViewController.DefinesPresentationContext Property


Specifies whether this UIViewController’s View is shown when presenting another UIViewController.

[get: Foundation.Export("definesPresentationContext")]
[set: Foundation.Export("setDefinesPresentationContext:")]
public virtual bool DefinesPresentationContext { get; set; }
member this.DefinesPresentationContext : bool with get, set

Property Value


The default is false.



When an application presents a view (i.e., using PresentViewController(UIViewController, Boolean, Action), PresentModalViewController(UIViewController, Boolean), or PresentMoviePlayerViewController(MPMoviePlayerViewController)), iOS calls this method on the presenting UIViewController. If this method returns false, iOS will call this method on ParentViewController. If no UIViewController in the chain return true, the presented UIViewController is presented using the root UIViewController context.

Applies to