# `GSLayer handleShapesFromShapes:`

*Instance Method*

Returns `subjects` reordered such that the relative order is the same as in `shapes`, excluding any shapes in `subjects` that are members of a shape group in `subjects`.

## Declaration

```swift
func handleShapes(from subjects: [GSShape]) -> [GSShape]?
```

```objc
- (NSArray<GSShape *> *) handleShapesFromShapes:(NSArray<GSShape *> *) subjects;
```

```python
handleShapesFromShapes_(subjects: list[GSShape]) -> list[GSShape]
```

## Discussion

Returns `nil` if the given array is empty or any of the shapes is not part of the layer.

## See Also

### Moving Shapes in Groups

- [`GSLayer moveShapes:copyBuffer:intoGroup:childIndex:`](/Core/GlyphsCore/GSLayer/moveShapes:copyBuffer:intoGroup:childIndex:) — Moves or copies the given shapes to a new location in the layer’s shape group tree.
- [`GSLayer createShapeGroupFromShapes:`](/Core/GlyphsCore/GSLayer/createShapeGroupFromShapes:) — Combines the given shapes into a new shape group.
- [`GSLayer dissolveShapeGroup:`](/Core/GlyphsCore/GSLayer/dissolveShapeGroup:) — Dissolves the given shape group by replacing it with its direct members.

