An object that provides the ability to present Game Center view controller classes in macOS.
- macOS 10.8+
Instantiate and configure a Game Center view controller as you do for iOS. To present the view controller in macOS, instantiate a new
GKDialog object or use the Singleton object provided by the
shared() class method. Set the
parent property of the dialog controller to the window that should display the view controller’s contents. Then, call the dialog controller’s
present(_:) method, passing in the view controller object to be presented. Later, when the view controller’s contents should be hidden, call the dialog controller’s
dismiss(_:) method. Listing 1 shows how to display a view controller that contains the scores for a single leaderboard.
Listing 2 shows how to dismiss the delegate for macOS.