TestsTested | ✓ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Mar 2015 |
Maintained by Kerr Marin Miller.
A TMDB API client that allows users to easily query movie and cast information.
To run the example project, clone the repo, and run pod install
from the Example directory first.
This project has a dependency on AFNetworking.
Other requirements:
In your app delegate, set your API key:
Code:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[KMMTMDBAPIClient client] setAPIKey:@"MY API KEY"];
return YES;
}
In your view controller, query the API:
Code:
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[[KMMTMDBAPIClient client] popularMoviesInPage:1 complete:^(id results, NSError *error) {
NSDictionary *firstMovie = results[@"results"][0];
self.titleLabel.text = firstMovie[@"original_title"];
self.releaseDateLabel.text = firstMovie[@"release_date"];
self.popularityLabel.text = [@"Popularity: " stringByAppendingFormat: @"%f", [firstMovie[@"popularity"] doubleValue] ];
}];
}
KMMTMDBAPIClient was developed by Kerr Marin Miller (@kerrmarin) in the development of Dejavu.
KMMTMDBAPIClient is available under the MIT license. See the LICENSE file for more info.