Class: GKAchievementDescription
Overview
An GKAchievementDescription object holds text and images used to describe an achievement. When you develop your game, you create localized achievement descriptions in iTunes Connect. At runtime, your game retrieves these descriptions from Game Center. Usually your game downloads the achievement descriptions when it wants to present a custom achievement user interface to the player.
Instance Attribute Summary (collapse)
-
- achievedDescription
readonly
A localized description to be used after the local player has completed the achievement.
-
- groupIdentifier
readonly
The identifier for the group the achievement description is part of.
-
- hidden
readonly
A Boolean value that states whether this achievement is initially visible to players.
-
- identifier
readonly
A unique string used to identify the achievement.
-
- image
readonly
An image to display for the completed achievement.
-
- maximumPoints
readonly
The number of points the player earns by completing this achievement.
-
- replayable
readonly
A Boolean value that states whether this achievement can be earned multiple times.
-
- title
readonly
A localized title for the achievement.
-
- unachievedDescription
readonly
A localized description of the achievement to be used when the local player has not completed the achievement.
Class Method Summary (collapse)
-
+ incompleteAchievementImage
A common image for incomplete achievements.
-
+ loadAchievementDescriptionsWithCompletionHandler:
Downloads the achievement descriptions from Game Center.
-
+ placeholderCompletedAchievementImage
A common image for completed achievements.
Instance Method Summary (collapse)
-
- loadImageWithCompletionHandler:
Loads the image property for a completed achievement.
Methods inherited from NSObject
#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version
Constructor Details
This class inherits a constructor from NSObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class NSObject
Instance Attribute Details
- (String) achievedDescription (readonly)
A localized description to be used after the local player has completed the achievement. (read-only)
- (String) groupIdentifier (readonly)
The identifier for the group the achievement description is part of. (read-only) If your game is configured to be part of a game group in iTunes Connect, this property holds the identifier you assigned to the achievement in the game group. If the game is not part of a game group, this property is nil.
- (Boolean) hidden (readonly)
A Boolean value that states whether this achievement is initially visible to players. (read-only) If the value of this property is NO, this achievement is always visible to the player. If YES, the achievement is not displayed in any of the standard achievement user interface screens. It remains hidden until the first time your game reports progress towards completing this achievement.
- (String) identifier (readonly)
A unique string used to identify the achievement. (read-only) The GKAchievementDescription property holds the identifier string you created for the achievement on iTunes Connect.
- (UIImage) image (readonly)
An image to display for the completed achievement. (read-only) The value of this property is undefined until after the image is loaded. See loadImageWithCompletionHandler:.
- (Integer) maximumPoints (readonly)
The number of points the player earns by completing this achievement. (read-only)
- (Boolean) replayable (readonly)
A Boolean value that states whether this achievement can be earned multiple times. (read-only) If the value of this property is NO, then the achievement may only be earned once. After the achievement is earned, Game Center ignores any further progress submitted for it. If the value of this property is YES, then the achievement is considered earned each time your game reports progress to Game Center that completes the achievement. This means that any appropriate banners are displayed to the player again, challenges based on the achievement are completed, and so on.
- (String) title (readonly)
A localized title for the achievement. (read-only)
- (String) unachievedDescription (readonly)
A localized description of the achievement to be used when the local player has not completed the achievement. (read-only)
Class Method Details
+ (UIImage) incompleteAchievementImage
A common image for incomplete achievements. On OS X, this class method returns an NSImage object but otherwise works identically.
+ (Object) loadAchievementDescriptionsWithCompletionHandler(completionHandler)
Downloads the achievement descriptions from Game Center. When this method is called, it creates a new background task to handle the request. The method then returns control to your game. Later, when the task is complete, Game Kit calls your completion handler. Keep in mind that the completion handler may be called on a thread other than the one originally used to invoke the method. This means that the code in your block needs to be thread-safe.
+ (UIImage) placeholderCompletedAchievementImage
A common image for completed achievements. When an achievement is completed, your game can display this image until the custom image for an achievement finishes loading.On OS X, this class method returns an NSImage object but otherwise works identically.
Instance Method Details
- (Object) loadImageWithCompletionHandler(completionHandler)
Loads the image property for a completed achievement. Your game should call loadImageWithCompletionHandler: for each achievement the user has completed. Your game should display the placeholder image until the image is successfully downloaded. After the block is called, the description’s image property holds the same image object that is returned to the block.When this method is called, it creates a new background task to handle the request. The method then returns control to your game. Later, when the task is complete, Game Kit calls your completion handler. Keep in mind that the completion handler may be called on a thread other than the one originally used to invoke the method. This means that the code in your block needs to be thread-safe.On OS X, this class method returns an NSImage object but otherwise works identically.