control(_:didFailToValidatePartialString:errorDescription:)
Invoked when the formatter for the cell belonging to control (or selected cell) rejects a partial string a user is typing into the cell.
Declaration
@MainActor optional func control(_ control: NSControl, didFailToValidatePartialString string: String, errorDescription error: String?)Parameters
- control:
The control whose cell rejected the string.
- string:
The string that includes the character that caused the rejection.
- error:
A localized, user-presentable string that explains why the string was rejected.
Discussion
You can implement this method to display a warning message or perform a similar action when the user enters improperly formatted text.