A TMDB API client that allows users to easily query movie and cast information.
- Get movie details, including similar movies.
- Get cast details.
- Get company details.
- Search for cast and crew.
- Search for movies.
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:
- iOS 7.0 or greater
- ARC
KMMTMDBAPIClient is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "KMMTMDBAPIClient"
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.