<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSApplication/ModalResponse",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:@T@NSModalResponse"
  },
  "title" : "NSApplication.ModalResponse"
}
-->

# NSApplication.ModalResponse

A set of button return values for modal dialogs.

```
struct ModalResponse
```

## Discussion

The response value that a button returns can depend on which method is used to present the dialog. See [`alertWithMessageText:defaultButton:alternateButton:otherButton:informativeTextWithFormat:`](/documentation/AppKit/NSAlert/alertWithMessageText:defaultButton:alternateButton:otherButton:informativeTextWithFormat:), [`runModal()`](/documentation/AppKit/NSAlert/runModal()), and [`addButton(withTitle:)`](/documentation/AppKit/NSAlert/addButton(withTitle:)) for examples.

## Topics

### Responses

[`OK`](/documentation/AppKit/NSApplication/ModalResponse/OK)

The presentation or dismissal of the sheet has finished.

[`cancel`](/documentation/AppKit/NSApplication/ModalResponse/cancel)

The presentation or dismissal of the sheet has been canceled.

[`continue`](/documentation/AppKit/NSApplication/ModalResponse/continue)

Modal session is continuing (returned by [`runModalSession(_:)`](/documentation/AppKit/NSApplication/runModalSession(_:)) only).

[`stop`](/documentation/AppKit/NSApplication/ModalResponse/stop)

Modal session was broken with [`stopModal()`](/documentation/AppKit/NSApplication/stopModal()).

[`abort`](/documentation/AppKit/NSApplication/ModalResponse/abort)

Modal session was broken with [`abortModal()`](/documentation/AppKit/NSApplication/abortModal()).

[`alertFirstButtonReturn`](/documentation/AppKit/NSApplication/ModalResponse/alertFirstButtonReturn)

The user clicked the first (rightmost) button on the dialog or sheet.

[`alertSecondButtonReturn`](/documentation/AppKit/NSApplication/ModalResponse/alertSecondButtonReturn)

The user clicked the second button from the right edge of the dialog or sheet.

[`alertThirdButtonReturn`](/documentation/AppKit/NSApplication/ModalResponse/alertThirdButtonReturn)

The user clicked the third button from the right edge of the dialog or sheet.

### Deprecated Responses

[`NSRunStoppedResponse`](/documentation/AppKit/NSRunStoppedResponse)

Modal session was broken with [`stopModal()`](/documentation/AppKit/NSApplication/stopModal()).

[`NSRunAbortedResponse`](/documentation/AppKit/NSRunAbortedResponse)

Modal session was broken with [`abortModal()`](/documentation/AppKit/NSApplication/abortModal()).

[`NSRunContinuesResponse`](/documentation/AppKit/NSRunContinuesResponse)

Modal session is continuing (returned by [`runModalSession(_:)`](/documentation/AppKit/NSApplication/runModalSession(_:)) only).

### Initializers

[`init(_:)`](/documentation/AppKit/NSApplication/ModalResponse/init(_:))

[`init(rawValue:)`](/documentation/AppKit/NSApplication/ModalResponse/init(rawValue:))



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)