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

# selectRowIndexes(_:byExtendingSelection:)

Sets in the receiver the indexes of rows that are selected.

```
func selectRowIndexes(_ indexes: IndexSet, byExtendingSelection extend: Bool)
```

## Parameters

`indexes`

The indexes of rows in the receiver to select.
  
  > Important:
  > Raises an `NSRangeException` if any index in `rowIndexes` is less than `0` or greater than or equal to the number of rows.

`extend`

If <doc://com.apple.documentation/documentation/Swift/false>, the selected rows are specified by `indexes`. If <doc://com.apple.documentation/documentation/Swift/true>, the rows indicated by `indexes` are added to the collection of already selected rows, providing multiple selection.

## Discussion

---

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)