Chapter 1. Game Center

Game Center is the Apple technology that allows game developers to integrate leaderboards, achievements, and multiplayer support, among other things, into their iOS apps. Why is it so important? Simply because Apple takes care of the server infrastructure of Game Center for you! Apple also provides iOS developers with a framework, called GameKit, to make Game Center integration into iOS Apps really easy.

Introducing GCD and Block Objects

Problem

You want to learn how to use block objects and Grand Central Dispatch so that you can write Game Center apps in iOS.

Solution

Learn the basics of block objects and Grand Central Dispatch here.

Discussion

All of us, at some point, have used threads. We use threads to separate the paths of execution in our code and to give priority to certain paths of execution over others. A classic example of this is the main UI thread in every iOS application. All iOS developers are encouraged to avoid keeping the UI thread busy for work that is non-UI-related, in order to sustain a responsive user interface. Therefore, all work that is not UI-related can, and indeed should, be executed in separate threads.

With the introduction of multicore mobile devices such as the iPad 2, threads and their management have become more complicated than ever before. Not only should developers know what path of execution is running at any instance, they should also know which core of the processor that path is running on in order to utilize the power of the ...

Get Writing Game Center Apps in iOS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.