An GKAchievementViewController object provides a standard user interface to display achievement progress for the local player. If the GKGameCenterViewController class is available, you should use it instead.


class GKAchievementViewController : GKGameCenterViewController


To show achievements for the local player, initialize a new GKAchievementViewController object and set the delegate. Then present the new view controller and wait for the delegate to be called. Once the delegate is called, dismiss the view controller.

On iOS, you present and dismiss the view controller from another view controller in your game, using the methods provided by the UIViewController class. In macOS, you use the GKDialogController class to present and dismiss the view controller in a window.

Subclassing Notes

The GKAchievementViewController class is not intended to be subclassed.


Setting the Delegate

var achievementDelegate: GKAchievementViewControllerDelegate!

The achievement view controller’s delegate.

See Also

Achievement View Controllers

protocol GKAchievementViewControllerDelegate

An object implementing the GKAchievementViewControllerDelegate protocol is called when the user dismisses the achievements view controller. Typically, this protocol is implemented by the object in your game that originally displayed the achievements user interface.