---
title: "state(forClass:)"
framework: gameplaykit
role: symbol
role_heading: Instance Method
path: "gameplaykit/gkstatemachine/state(forclass:)"
---

# state(forClass:)

## Declaration

```swift
func state<StateType>(forClass stateClass: StateType.Type) -> StateType? where StateType : GKState
```
