---
title: commitEditing()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nsviewcontroller/commitediting()
---

# commitEditing()

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

## Declaration

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

## Return Value

Return Value Returns true if the changes were successfully applied to the model, false otherwise.

## Discussion

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

## See Also

### NSEditor Conformance

- [commitEditing(withDelegate:didCommit:contextInfo:)](appkit/nsviewcontroller/commitediting(withdelegate:didcommit:contextinfo:).md)
- [discardEditing()](appkit/nsviewcontroller/discardediting().md)
