---
title: "insert(_:at:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsmutableorderedset/insert(_:at:)-3ncnm"
---

# insert(_:at:)

Inserts the objects in the array at the specified indexes.

## Declaration

```swift
func insert(_ objects: [Any], at indexes: IndexSet)
```

## Parameters

- `objects`: An array of objects to insert into the mutable ordered set.
- `indexes`: The indexes at which the objects in objects should be inserted. The count of locations in indexes must equal the count of objects.

## Discussion

Discussion Each object in objects is inserted into the receiving mutable ordered set in turn at the corresponding location specified in indexes after earlier insertions have been made.

## See Also

### Adding, Removing, and Reordering Entries

- [add(_:)](foundation/nsmutableorderedset/add(_:).md)
- [add(_:count:)](foundation/nsmutableorderedset/add(_:count:).md)
- [addObjects(from:)](foundation/nsmutableorderedset/addobjects(from:).md)
- [insert(_:at:)](foundation/nsmutableorderedset/insert(_:at:)-7qg51.md)
- [remove(_:)](foundation/nsmutableorderedset/remove(_:).md)
- [removeObject(at:)](foundation/nsmutableorderedset/removeobject(at:).md)
- [removeObjects(at:)](foundation/nsmutableorderedset/removeobjects(at:).md)
- [removeObjects(in:)](foundation/nsmutableorderedset/removeobjects(in:)-8h2kh.md)
- [removeObjects(in:)](foundation/nsmutableorderedset/removeobjects(in:)-9jkis.md)
- [removeAllObjects()](foundation/nsmutableorderedset/removeallobjects().md)
- [replaceObject(at:with:)](foundation/nsmutableorderedset/replaceobject(at:with:).md)
- [replaceObjects(at:with:)](foundation/nsmutableorderedset/replaceobjects(at:with:).md)
- [replaceObjects(in:with:count:)](foundation/nsmutableorderedset/replaceobjects(in:with:count:).md)
- [setObject(_:at:)](foundation/nsmutableorderedset/setobject(_:at:).md)
- [moveObjects(at:to:)](foundation/nsmutableorderedset/moveobjects(at:to:).md)
