<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSMutableIndexSet/shiftIndexesStarting(at:by:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSMutableIndexSet(im)shiftIndexesStartingAtIndex:by:"
  },
  "title" : "shiftIndexesStarting(at:by:)"
}
-->

# shiftIndexesStarting(at:by:)

Shifts a group of indexes to the left or the right within the receiver.

```
func shiftIndexesStarting(at index: Int, by delta: Int)
```

## Parameters

`index`

Head of the group of indexes to shift.

`delta`

Amount and direction of the shift. Positive integers shift the indexes to the right. Negative integers shift the indexes to the left.

## Discussion

The group of indexes shifted is made up by `index` and the indexes that follow it in the set.

A left shift deletes the indexes in a range the length of `delta` preceding `index` from the set.

A right shift inserts empty space in the range `(``index``,``delta``)` in the receiver.

The resulting indexes must all be in the range `0 .. NSNotFound - 1`.

---

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)