---
title: "shift(startingAt:by:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/indexset/shift(startingat:by:)"
---

# shift(startingAt:by:)

For a positive delta, shifts the indexes in [index, INT_MAX] to the right, thereby inserting an “empty space” [index, delta], for a negative delta, shifts the indexes in [index, INT_MAX] to the left, thereby deleting the indexes in the range [index - delta, delta].

## Declaration

```swift
mutating func shift(startingAt integer: IndexSet.Element, by delta: Int)
```
