Skip to content
forked from troystump/LoLAPI

RESTful Objective-C client for the popular online game "League of Legends" by Riot Games.

License

Notifications You must be signed in to change notification settings

FlorinDob/LoLAPI

 
 

Repository files navigation

LoLAPI

LoLAPI is the most powerful Objective-C RESTful client for the popular online game "League of Legends" by Riot Games. All available web services exposed by the official League of Legends API come fully object mapped, allowing developers to focus on writing their LoL applications without the hassle (or knowledge) of network setup and web service consumption.

Getting Started

To begin using LoLAPI in your project, simply setup your League of Legends API key and desired region by following the example:

#import <LoLAPI/LoLAPI.h>
...

// Initialize the LoLAPI
[LoLAPIManager initWithAPIKey:@"<your_key>" region:LoLRegionIDNorthAmerica];

Examples

Get all champions

[LoLAPIManager getChampionsWithFreeToPlayStatusOnly:NO success:^(LoLChampionList *championList) {
    for (LoLChampion *champion in championList.champions) {
        NSLog(@"champion id is: %ld", (long)[champion.id integerValue]);
    }
} failure:^(NSError *error) {
    UIAlertView *errorAlert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Failed to retreive champions. Please try again later." delegate:self cancelButtonTitle:@"Okay" otherButtonTitles:nil];
    
    [errorAlert show];
}];

Requirements

LoLAPI requires iOS 5.0 and above or Mac OS X 10.7 and above.

LoLAPI depends on the following third party, open source libraries:

  1. RestKit - Networking Support, Object Mapping (integrated with Core Data)

The following Cocoa frameworks must be linked into the application target for proper compilation:

  1. CFNetwork.framework on iOS
  2. CoreData.framework
  3. Security.framework
  4. MobileCoreServices.framework on iOS or CoreServices.framework on OS X

And the following linker flags must be set:

  1. -ObjC
  2. -all_load

ARC

The LoLAPI codebase is completely written using ARC.

If you are including the LoLAPI sources directly into a project that does not yet use Automatic Reference Counting, you will need to set the -fobjc-arc compiler flag on all of the LoLAPI source files. To do this in Xcode, go to your active target and select the "Build Phases" tab. Now select all LoLAPI source files, press Enter, insert -fobjc-arc and then "Done" to enable ARC for LoLAPI.

Installation

The recommended approach for installing LoLAPI is via the CocoaPods package manager, as it provides flexible dependency management and dead simple installation. For best results, it is recommended that you install via CocoaPods >= 0.19.1 using Git >= 1.8.0 installed via Homebrew.

via CocoaPods

Install CocoaPods if not already available:

$ [sudo] gem install cocoapods
$ pod setup

Change to the directory of your Xcode project, and Create and Edit your Podfile and add LoLAPI:

$ cd /path/to/MyProject
$ touch Podfile
$ edit Podfile
platform :ios, '5.0' 
# Or platform :osx, '10.7'
pod 'LoLAPI', '~> 0.1.0'

Install into your project:

$ pod install

Open your project in Xcode from the .xcworkspace file (not the usual project file)

$ open MyProject.xcworkspace

Please note that if your installation fails, it may be because you are installing with a version of Git lower than CocoaPods is expecting. Please ensure that you are running Git >= 1.8.0 by executing git --version. You can get a full picture of the installation details by executing pod install --verbose.

From a Release Package or as a Git submodule

If you have successful instructions on how to install using this method, please share with me so that I can begin a wiki for others to see.

License

LoLAPI is licensed under the terms of the Apache License, version 2.0. Please see the LICENSE file for full details.

Credits

LoLAPI is brought to you by Troy Stump. Special thanks to Blake Watters and the RestKit team for their amazing framework (and also for the formatting of this README).

About

RESTful Objective-C client for the popular online game "League of Legends" by Riot Games.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 99.3%
  • Ruby 0.7%