[![CI Status](http://img.shields.io/travis/Karen Lusinyan/CommonUtilsGame.svg?style=flat)](https://travis-ci.org/Karen Lusinyan/CommonUtilsGame)
To run the example project, clone the repo, and run pod install
from the Example directory first.
Put this in your AppDelegate.m
// If you already setup leaderboard in iTunesConnect -> pass the leaderboard's identifier
static NSString * LeaderboardIdentifier = @"My-Leaderboard";
[CommonGameCenter createLeaderboardIfNotExists:LeaderboardIdentifier attributes:nil];
// ... setup more leaderboars
[CommonGameCenter startAuthenticationWithCompletion:^(BOOL authenticated, NSError *error) {
// game center started either offline or online
}];
#import CommonGameCenter.h
// Obtain score from leaderboard (returns GKScore)
[CommonGameCenter obtainScoreForLeaderboard:@"My-Leaderboard"]
// Report score to leaderboard
[CommonGameCenter reportScore:100 forLeaderboard:@"My-Leaderboard"];
That's it!
Enjoy
Comming soon :-)
Requires iOS 7 and later
Written in ARC
CommonUtilsGame is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "CommonUtilsGame"
Karen Lusinyan, [email protected]
CommonUtilsGame is available under the MIT license. See the LICENSE file for more info.