Adding Achievement Hooks

The biggest challenge in implementing achievements into your app is adding the hooks to activate and progress those achievements into your normal routines. In my personal experience, I have found that adding these hooks when the program is almost finished is easier than trying to add them in as you go. In this section, I will provide a number of examples of how to tie in achievements; your own app may differ significantly, but you should be able to easily adapt the examples to suit your needs.

To make achievements easier to retrieve progress details, we first add a few convenience methods to our GameCenterManager class. This is the first method we will use to populate the local achievement cache.

-(void)populateAchievementCache ...

Get Beginning iOS Game Center and Game Kit: For iPhone, iPad, and iPod touch now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.