---
title: "setGraphicsState(_:)"
framework: appkit
role: symbol
role_heading: Type Method
path: "appkit/nsgraphicscontext/setgraphicsstate(_:)"
---

# setGraphicsState(_:)

Makes the graphics context of the specified graphics state current, and resets graphics state.

## Declaration

```swift
class func setGraphicsState(_ gState: Int)
```

## Discussion

Discussion The graphicState identifier must be created in the calling thread.

## See Also

### Managing the Graphics State

- [restoreGraphicsState()](appkit/nsgraphicscontext/restoregraphicsstate()-swift.type.method.md)
- [restoreGraphicsState()](appkit/nsgraphicscontext/restoregraphicsstate()-swift.method.md)
- [saveGraphicsState()](appkit/nsgraphicscontext/savegraphicsstate()-swift.type.method.md)
- [saveGraphicsState()](appkit/nsgraphicscontext/savegraphicsstate()-swift.method.md)
