Prerequisites:
- Apple Developers Account
- Setup GameCenter Leaderboards with iTunesConnect
Setting up GameCenter Leaderboards:
- Sign in to iTunesConnect
- Go to My Apps. Create an app for your project then go to Features.
- Click on Game Center
- Click the plus sign next to Leaderboards.
- Choose Single Leaderboard for Leaderboard types.
- Create a Leaderboard Reference Name for your reference.
- Create a Leaderboard ID for your app to refer to when reporting scores.
- Set score format to Integer
- Score Submission will be Best Score
- Click Add language and fill the entries.
Copy your LeaderboardID
that you made and lets head over to Xcode.
Working with Xcode
There are 4 functions that we will be working with.
- Importing the framework and setting up the protocols
- Checking if the user is signed in to GameCenter
- Reporting the scores to GameCenter