Contents

selectionShouldChange(in:)

Returns a Boolean value that indicates whether the outline view should change its selection.

Declaration

@MainActor optional func selectionShouldChange(in outlineView: NSOutlineView) -> Bool

Parameters

  • outlineView:

    The outline view that sent the message.

Return Value

true to permit outlineView to change its selection (typically a row being edited), false to deny permission.

Discussion

For example, if the user is editing a cell and enters an improper value, the delegate can prevent the user from selecting or editing any other cells until a proper value has been entered into the original cell. The delegate can implement this method for complex validation of edited rows based on the values of any of their cells.

See Also

Handling Selection