---
title: state
framework: compositorservices
role: symbol
role_heading: Instance Property
path: compositorservices/layerrenderer/state-swift.property
---

# state

A value that indicates whether the layer renderer is currently visible and ready for you to draw content.

## Declaration

```swift
var state: LayerRenderer.State { get }
```

## Discussion

Discussion Use the state of the layer to determine when to start and stop your rendering loop. When the layer is in the LayerRenderer.State.running state, draw frames of content using your rendering loop. Stop your rendering loop when the layer enters other states. When the layer reaches the LayerRenderer.State.invalidated state, clean up and deallocate your render loop structures.

## See Also

### Managing the rendering loop

- [waitUntilRunning()](compositorservices/layerrenderer/waituntilrunning().md)
- [LayerRenderer.State](compositorservices/layerrenderer/state-swift.enum.md)
- [LayerRenderer.Clock](compositorservices/layerrenderer/clock.md)
