# `GSLayer transform:checkForSelection:`

*Instance Method*

Applies an affine transform to editable layer content.

## Declaration

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

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

```python
transform_checkForSelection_(transform: NSAffineTransform, checkForSelection: bool)
```

## Parameters

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

## See Also

### General Transformations

- [`GSLayer transformSelection:`](/Core/GlyphsCore/GSLayer/transformSelection:) — Applies an affine transform to the selected elements.
- [`GSLayer transform:checkForSelection:doComponents:`](/Core/GlyphsCore/GSLayer/transform:checkForSelection:doComponents:) — 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.

