Instance Method
createShapeGroup(from:)createShapeGroupFromShapes:createShapeGroupFromShapes_
Combines the given shapes into a new shape group.
Declaration
func createShapeGroup(from memberCandidates: [GSShape]) -> GSShapeGroup?Declaration
- (GSShapeGroup *) createShapeGroupFromShapes:(NSArray<GSShape *> *) memberCandidates;Declaration
createShapeGroupFromShapes_(memberCandidates: list[GSShape]) -> GSShapeGroupReturn 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
Returns
subjectsreordered such that the relative order is the same as inshapes, excluding any shapes insubjectsthat are members of a shape group insubjects.Moves or copies the given shapes to a new location in the layer’s shape group tree.
Dissolves the given shape group by replacing it with its direct members.