beginSheet(_:completionHandler:)
Starts a document-modal session and presents—or queues for presentation—a sheet.
Declaration
func beginSheet(_ sheetWindow: NSWindow, completionHandler handler: ((NSApplication.ModalResponse) -> Void)? = nil)func beginSheet(_ sheetWindow: NSWindow) async -> NSApplication.ModalResponseParameters
- sheetWindow:
The window object that represents the sheet to present.
- handler:
The completion handler that gets called when the sheet’s modal session ends.
Discussion
If the window already has a presented sheet, this method queues the specified sheet for presentation after the current sheet is dismissed and then returns control to the caller.
If the window has no presented sheets, this method displays the specified sheet, makes it key, and returns control to the caller. While the sheet remains visible, most events targeted at the receiver are prohibited. The runloop does not enter any special mode to accomplish this.