Reports progress on an array of achievements.
- iOS 6.0+
- macOS 10.8+
- tvOS 9.0+
- watchOS 2.0+
An array of
GKAchievementobjects that contains the achievements whose progress is being updated.
A block to be called after the operation completes.
The block takes the following parameter:
If the operation was successful, this value is
nil; otherwise, this parameter holds an object that describes the problem that occurred.
Use this class method whenever you need to submit one or more achievement updates at the same time. Calling this method reports each of the achievements in the array. Processing multiple achievements at once allows the entire operation to be processed more efficiently using this method as the completion handler is only called once. Listing 1 shows an example of how to report a single achievement.
Listing 2 shows an example of how to report multiple achievements for the local player.
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. The completion handler is always called on the main thread.