# `GSLayer swapForegroundWithBackground`

*Instance Method*

Exchanges shapes, anchors, and hints between the foreground and background layers.

## Declaration

```swift
func swapForegroundWithBackground()
```

```objc
- (void) swapForegroundWithBackground;
```

```python
swapForegroundWithBackground()
```

## Discussion

Other layer content, including background images, is not exchanged.

## See Also

### Background Layer

- [`GSBackgroundLayer`](/Core/GlyphsCore/GSBackgroundLayer) — Editable background content associated with a foreground layer.
- [`GSLayer.background`](/Core/GlyphsCore/GSLayer/background) — Editable background content associated with the layer.
- [`GSLayer hasBackground`](/Core/GlyphsCore/GSLayer/hasBackground) — Whether a background layer has been created.
- [`GSLayer contentToBackgroundCheckSelection:keepOldBackground:`](/Core/GlyphsCore/GSLayer/contentToBackgroundCheckSelection:keepOldBackground:) — Copies shapes and anchors to the corresponding foreground or background layer.

