---
title: "moveItem(at:to:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsscrubber/moveitem(at:to:)"
---

# moveItem(at:to:)

Moves an item from one index to another in the scrubber.

## Declaration

```swift
func moveItem(at oldIndex: Int, to newIndex: Int)
```

## Parameters

- `oldIndex`: The index of the item that you want to move.
- `newIndex`: The index of the item’s new location.

## See Also

### Inserting, moving, and deleting items

- [insertItems(at:)](appkit/nsscrubber/insertitems(at:).md)
- [removeItems(at:)](appkit/nsscrubber/removeitems(at:).md)
