---
title: viewState
framework: gamekit
role: symbol
role_heading: Instance Property
path: gamekit/gkgamecenterviewcontroller/viewstate
---

# viewState

The content that the Game Center controller displays.

## Declaration

```swift
var viewState: GKGameCenterViewControllerState { get set }
```

## Discussion

Discussion See GKGameCenterViewControllerState for possible values. When you first present the Game Center view controller, the content displayed by the view controller is determined by this property. If the player navigates to different content, the view state is automatically updated. For example, to preserve the player’s selections, you can read the viewState property after the screen is dismissed, and set that value the next time you initialize the view controller.

## See Also

### Deprecated Properties

- [leaderboardIdentifier](gamekit/gkgamecenterviewcontroller/leaderboardidentifier.md)
- [leaderboardCategory](gamekit/gkgamecenterviewcontroller/leaderboardcategory.md)
- [leaderboardTimeScope](gamekit/gkgamecenterviewcontroller/leaderboardtimescope.md)
