<!--
{
  "availability" : [
    "macOS: 10.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSViewController/commitEditing()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSViewController(im)commitEditing"
  },
  "title" : "commitEditing()"
}
-->

# commitEditing()

Returns whether the receiver was able to commit any pending edits.

```
@MainActor func commitEditing() -> Bool
```

## Return Value

Returns <doc://com.apple.documentation/documentation/Swift/true> if the changes were successfully applied to the model, <doc://com.apple.documentation/documentation/Swift/false> otherwise.

## Discussion

A commit is denied if the receiver fails to apply the changes to the model object, perhaps due to a validation error.

---

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)