Instance Property

presentingViewController

The view controller that presented this view controller.

Declaration

@property(nonatomic, readonly) UIViewController *presentingViewController;

Discussion

When you present a view controller modally (either explicitly or implicitly) using the presentViewController:animated:completion: method, the view controller that was presented has this property set to the view controller that presented it. If the view controller was not presented modally, but one of its ancestors was, this property contains the view controller that presented the ancestor. If neither the current view controller or any of its ancestors were presented modally, the value in this property is nil.

See Also

Getting Other Related View Controllers

presentedViewController

The view controller that is presented by this view controller, or one of its ancestors in the view controller hierarchy.

parentViewController

The parent view controller of the recipient.

splitViewController

The nearest ancestor in the view controller hierarchy that is a split view controller.

navigationController

The nearest ancestor in the view controller hierarchy that is a navigation controller.

tabBarController

The nearest ancestor in the view controller hierarchy that is a tab bar controller.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software