Contents

setSelectionIndexes(_:)

Sets the receiver’s selection indexes and returns a Boolean value that indicates whether the selection changed.

Declaration

func setSelectionIndexes(_ indexes: IndexSet) -> Bool

Parameters

  • indexes:

    The set of selection indexes for the receiver.

Return Value

true if the selection was changed, otherwise false.

Discussion

Attempting to change the selection may cause a commitEditing() message which fails, thus denying the selection change.

To select all the receiver’s objects, indexes should be an index set with indexes [0...count -1]. To deselect all indexes, pass an empty index set.

See Also

Managing selections