# `GSLayer transform:checkForSelection:doComponents:`

*Instance Method*

Applies an affine transform to editable layer content.

## Declaration

```swift
func transform(_ transform: AffineTransform, checkForSelection: Bool, doComponents: Bool)
```

```objc
- (void) transform:(NSAffineTransform *) transform checkForSelection:(BOOL) checkForSelection doComponents:(BOOL) doComponents;
```

```python
transform_checkForSelection_doComponents_(transform: NSAffineTransform, checkForSelection: bool, doComponents: bool)
```

## Parameters

- `checkForSelection` — Whether to restrict the operation to selected elements when the selection is not empty.
- `doComponents` — Whether to transform component shapes.

## See Also

### General Transformations

- [`GSLayer transformSelection:`](/Core/GlyphsCore/GSLayer/transformSelection:) — Applies an affine transform to the selected elements.
- [`GSLayer transform:checkForSelection:`](/Core/GlyphsCore/GSLayer/transform:checkForSelection:) — Applies an affine transform to editable layer content.
- [`GSLayer transform:checkForSelection:doComponent:`](/Core/GlyphsCore/GSLayer/transform:checkForSelection:doComponent:) — Applies an affine transform to editable layer content and conditionally transforms components.
- [`GSLayer transformFast:`](/Core/GlyphsCore/GSLayer/transformFast:) — Applies an affine transform to the complete layer without normal edit bookkeeping.
- [`GSLayer transformFast:doComponent:`](/Core/GlyphsCore/GSLayer/transformFast:doComponent:) — Applies an affine transform to the complete layer and conditionally transforms components without normal edit bookkeeping.

