# `GSLayer copyWithOptions:selection:`

*Instance Method*

Creates an independent copy with the requested optional content and selection handling.

## Declaration

```swift
func copy(options: GSGlyphCopyOptions = [], selection: Bool) -> Self
```

```objc
- (instancetype) copyWithOptions:(GSGlyphCopyOptions) options selection:(BOOL) selection;
```

```python
copyWithOptions_selection_(options: GSGlyphCopyOptions, selection: bool) -> GSLayer
```

## Parameters

- `options` — The content and initialization behavior to use for the copy.
- `selection` — Whether selected elements are mapped to the corresponding elements in the copy.

## Discussion

Selection is included only when the options include [`GSGlyphCopyOptions.GSGlyphCopyExtras`](/Core/GlyphsCore/GSGlyphCopyOptions/GSGlyphCopyExtras).

## See Also

### Copying

- [`GSLayer copyWithOptions:`](/Core/GlyphsCore/GSLayer/copyWithOptions:) — Creates an independent copy with the requested optional content.

