KMMTMDBAPIClient 1.5

KMMTMDBAPIClient 1.5

测试测试
语言语言 Obj-CObjective C
许可证 MIT
发布最新版本2015年3月

Kerr Marin Miller维护。



  • Kerr Marin Miller

特性

一个允许用户轻松查询电影和演员信息的 TMDB API 客户端。

  • 获取电影详情,包括类似电影。
  • 获取演员详情。
  • 获取公司详情。
  • 搜索演员和工作人员。
  • 搜索电影。

用法

要运行示例项目,先克隆仓库,然后从 Example 目录运行 pod install

要求

此项目依赖于 AFNetworking。

其他要求

  • iOS 7.0 或更高版本
  • ARC

安装

示例

在您的应用Delegate中设置您的API密钥

代码

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [[KMMTMDBAPIClient client] setAPIKey:@"MY API KEY"];
    return YES;
}

在您的ViewController中查询API

代码

- (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 由 Kerr Marin Miller (@kerrmarin) 在开发 Dejavu 时开发。

许可证

KMMTMDBAPIClient 在 MIT 许可下可用。有关更多信息,请参阅 LICENSE 文件。