Presenting a Leaderboard

Now that we have a leaderboard in iTunes Connect, and populated a score into that leaderboard, it is time to present the leaderboard to the user. There are two ways of presentation: the first is with Apple's GUI; the second is with a custom GUI. This section will take a look at the implementation using Apple's GUI. In the next section, you will learn how to present a leaderboard with custom graphics.

Before we can begin, we need to create a new button that will trigger the leaderboard. We want to do this outside of the game screen, because you do not want to drag the user away from a game in progress to view a leaderboard. Begin by adding a new button to the UFOViewController view, as shown in Figure 3–7.

Figure ...

Get Beginning iOS Game Center and Game Kit: For iPhone, iPad, and iPod touch 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.