# `GSLayer pathSubtractKeepOverlaps:error:`

*Instance Method*

Subtracts selected paths from unselected paths.

## Declaration

```swift
func pathSubtractKeepOverlaps(_ keepOverlaps: Bool) throws
```

```objc
- (BOOL) pathSubtractKeepOverlaps:(BOOL) keepOverlaps error:(NSError **) error;
```

```python
pathSubtractKeepOverlaps_error_(keepOverlaps: bool) -> tuple[bool, NSError]
```

## Parameters

- `keepOverlaps` — Whether to preserve overlapping path fragments in the result.
- `error` — On output, a pointer to an error object that describes why the method failed, or `nil` if no error occurred. If you are not interested in the error information, pass `nil` for this parameter.

## Return Value

Whether the operation completed successfully.

## See Also

### Boolean Operations

- [`GSLayer removeOverlapCheckSelection:error:`](/Core/GlyphsCore/GSLayer/removeOverlapCheckSelection:error:) — Removes overlaps between applicable paths.
- [`GSLayer removeOverlapCheckSelection:keepOpenPaths:grid:error:`](/Core/GlyphsCore/GSLayer/removeOverlapCheckSelection:keepOpenPaths:grid:error:) — Removes overlaps between applicable paths using explicit open-path and grid settings.
- [`GSLayer removeOverlap:grid:error:`](/Core/GlyphsCore/GSLayer/removeOverlap:grid:error:) — Removes overlaps between paths according to a set of options.
- [`GSLayer pathSubtract:`](/Core/GlyphsCore/GSLayer/pathSubtract:) — Subtracts selected paths from unselected paths.
- [`GSLayer pathSubtract:from:keepOverlaps:error:`](/Core/GlyphsCore/GSLayer/pathSubtract:from:keepOverlaps:error:) — Subtracts one mutable path collection from another.
- [`GSLayer pathIntersect:`](/Core/GlyphsCore/GSLayer/pathIntersect:) — Intersects selected paths with unselected paths.
- [`GSLayer pathIntersectCheckSelection:error:`](/Core/GlyphsCore/GSLayer/pathIntersectCheckSelection:error:) — Intersects applicable selected and unselected paths.

