dismissModalViewControllerAnimated:
Dismisses the view controller that was presented by the receiver.
Declaration
- (void) dismissModalViewControllerAnimated:(BOOL) animated;Parameters
- animated:
If True, this method animates the view as it’s dismissed; otherwise, it does not. The style of animation is determined by the value in the Modaltransitionstyle property of the view controller being dismissed.
Discussion
The presenting view controller is responsible for dismissing the view controller it presented. If you call this method on the presented view controller itself, however, it automatically forwards the message to the presenting view controller.
If you present several view controllers in succession, and thus build a stack of presented view controllers, calling this method on a view controller lower in the stack dismisses its immediate child view controller and all view controllers above that child on the stack. When this happens, only the top-most view is dismissed in an animated fashion; any intermediate view controllers are simply removed from the stack. The top-most view is dismissed using its modal transition style, which may differ from the styles used by other view controllers lower in the stack.
If you want to retain a reference to the receiver’s presented view controller, get the value in the modalViewController property before calling this method.
See Also
Deprecated methods
setOverrideTraitCollection(_:forChild:)overrideTraitCollection(forChild:)attemptRotationToDeviceOrientation()registerForPreviewing(with:sourceView:)unregisterForPreviewing(withContext:)automaticallyForwardAppearanceAndRotationMethodsToChildViewControllerscanPerformUnwindSegueAction(_:from:withSender:)didAnimateFirstHalfOfRotationToInterfaceOrientation:didRotate(from:)dismissMoviePlayerViewControllerAnimated()forUnwindSegueAction(_:from:withSender:)presentModalViewController:animated:presentMoviePlayerViewControllerAnimated(_:)rotatingFooterView()rotatingHeaderView()