Instance Method

dismiss(_:)

Dismisses a presented view controller, using the same animator that presented it.

Declaration

func dismiss(_ viewController: NSViewController)

Parameters

viewController

The presented view controller that you are dismissing.

Discussion

In macOS, this is the universal way to dismiss a view controller, no matter how it was presented.

See Also

Presenting Another View Controller’s Content

func present(NSViewController, animator: NSViewControllerPresentationAnimator)

Presents another view controller using a specified, custom animator for presentation and dismissal.

func presentAsModalWindow(NSViewController)

Presents another view controller as a modal window, also known as an alert.

func presentAsSheet(NSViewController)

Presents another view controller as a sheet.