Instance Property

viewState

The content displayed by the Game Center controller.

Declaration

var viewState: GKGameCenterViewControllerState { get set }

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

enum GKGameCenterViewControllerState

Possible values for the viewState property.

var leaderboardIdentifier: String?

The named leaderboard that is displayed by the view controller.

var leaderboardCategory: String?

The named leaderboard that is displayed by the view controller.

Deprecated
var leaderboardTimeScope: GKLeaderboard.TimeScope

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