Latest 0.1.5
Homepage https://github.com/troystump/LoLAPI
License Apache License, Version 2.0
Platforms ios 5.0, osx 10.7, requires ARC
Dependencies RestKit
Authors

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).

Latest podspec

{
    "name": "LoLAPI",
    "version": "0.1.5",
    "summary": "RESTful Objective-C client for the popular online game "League of Legends" by Riot Games.",
    "description": "tttLoLAPI is the most powerful Objective-C RESTful client for the popular online game "League of Legends" by Riot Games. All client responses are fully object mapped, allowing developers to focus on writing their application without the hassle of consuming web services.n",
    "license": "Apache License, Version 2.0",
    "authors": {
        "troystump": "[email protected]"
    },
    "homepage": "https://github.com/troystump/LoLAPI",
    "social_media_url": "http://twitter.com/troystump",
    "source": {
        "git": "https://github.com/troystump/LoLAPI.git",
        "tag": "v0.1.5"
    },
    "source_files": "LoLAPI/Code/**/*.{h,m}",
    "header_mappings_dir": "LoLAPI/Code",
    "platforms": {
        "ios": "5.0",
        "osx": "10.7"
    },
    "requires_arc": true,
    "prefix_header_contents": "      #import nn      #define _AFNETWORKING_PIN_SSL_CERTIFICATES_nn      #if __IPHONE_OS_VERSION_MIN_REQUIREDn          #import n          #import n          #import n      #elsen          #import n          #import n          #import n      #endifn",
    "dependencies": {
        "RestKit": [
            "~> 0.23.3"
        ]
    }
}

Pin It on Pinterest

Share This