---
title: setNextState()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nsbutton/setnextstate()
---

# setNextState()

Sets the button to its next state.

## Declaration

```swift
func setNextState()
```

## Discussion

Discussion If the button has three states, it cycles through them in this order: on, off, mixed, on, and so forth. If the button has two states, it toggles between them.

## See Also

### Managing button state

- [allowsMixedState](appkit/nsbutton/allowsmixedstate.md)
- [state](appkit/nsbutton/state.md)
- [highlight(_:)](appkit/nsbutton/highlight(_:).md)
