# `GSLayer insertObject:inShapesAtIndex:`

*Instance Method*

Inserts a shape at the given linear shape index.

## Declaration

```swift
func insertShape(_ shape: GSShape, at idx: Int)
```

```objc
- (void) insertObject:(GSShape *) shape inShapesAtIndex:(NSInteger) idx;
```

```python
insertObject_inShapesAtIndex_(shape: GSShape, idx: int)
```

## See Also

### Adding Shapes

- [`GSLayer addShape:`](/Core/GlyphsCore/GSLayer/addShape:) — Adds a shape at the top of the layer.
- [`GSLayer addShapeFast:`](/Core/GlyphsCore/GSLayer/addShapeFast:) — Adds a shape at the top of the layer without undo registration or KVO notifications.
- [`GSLayer addShapes:`](/Core/GlyphsCore/GSLayer/addShapes:) — Adds shapes at the top of the layer.
- [`GSLayer addShapesFast:`](/Core/GlyphsCore/GSLayer/addShapesFast:) — Adds shapes at the top of the layer without undo registration or KVO notifications.

