Instance Property

viewState

The content displayed by the Game Center controller.

Declaration

iOS, Mac Catalyst
@property(assign, nonatomic) GKGameCenterViewControllerState viewState;
macOS
@property(assign, atomic) GKGameCenterViewControllerState viewState;

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

Configuring the Game Center Controller’s Content

GKGameCenterViewControllerState

Possible values for the viewState property.

leaderboardIdentifier

The named leaderboard that is displayed by the view controller.

leaderboardCategory

The named leaderboard that is displayed by the view controller.

Deprecated
leaderboardTimeScope

A time filter used to restrict which scores are displayed to the player.