Declaration

func createShapeGroup(from memberCandidates: [GSShape]) -> GSShapeGroup?

Declaration

- (GSShapeGroup *) createShapeGroupFromShapes:(NSArray<GSShape *> *) memberCandidates;

Declaration

createShapeGroupFromShapes_(memberCandidates: list[GSShape]) -> GSShapeGroup

Return Value

The newly created shape group. nil is returned if one of the given shapes is not part of the layer’s shapes or the given shapes array is empty.

Discussion

The newly created shape group is placed in the layer’s shape group tree where the topmost shape in memberCandidates is located.

Any shape groups in memberCandidates are moved together with all their members into the new shape group. Therefore, for any shape group in memberCandidates, it is not necessary to include any of its members in memberCandidates, but their inclusion is allowed.

The new shape group contains the given shapes in the same relative order as they appear in the layer’s shapes array.

See Also

Moving Shapes in Groups