iOS Developer Library

Developer

GameKit Framework Reference GKAchievementViewController Class Reference

Options
Deployment Target:

On This Page
Language:

GKAchievementViewController

Import Statement


Swift

import GameKit

Objective-C

@import GameKit;

Availability


Available in iOS 4.1 and later
Deprecated in iOS 7.0

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.

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. On OS X, 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.

  • The achievement view controller’s delegate.

    Declaration

    Swift

    unowned(unsafe) var achievementDelegate: GKAchievementViewControllerDelegate!

    Objective-C

    @property(assign, nonatomic) id< GKAchievementViewControllerDelegate > achievementDelegate

    Discussion

    Your game must set the delegate before presenting the view controller.

    Import Statement

    Objective-C

    @import GameKit;

    Swift

    import GameKit

    Availability

    Available in iOS 4.1 and later