Aubergine 0.0.5

Aubergine 0.0.5

测试已测试
Lang语言 Obj-CObjective C
许可 MIT
发布最后发布2015年4月

Tom Jowett维护。



 
依赖
AFNetworking~> 2.4
Mantle~> 1.5.4
 

Aubergine 0.0.5

  • Tom Jowett

Aubergine是一个用于Uber API的iOS SDK。

Aubergine使用Mantle框架进行JSON序列化并与AFNetworking结合使用。请随时提交PR,并欢迎您分享在项目中使用它的经验。

安装

Aubergine可通过CocoaPods获取。要安装它,只需将以下行添加到您的Podfile中

pod "Aubergine"

用法

要运行示例项目,请克隆仓库,并在示例目录中首先运行pod install

要在自己的应用中使用Aubergine,请在您的app的信息.plist文件中添加一行“AUBRequestManagerServerTokenKey”和您的Uber API服务器令牌的值,然后开始制作Uber请求。

#import <Aubergine/Aubergine.h>

AUBRequestManager *manager = [AUBRequestManager sharedInstance];

CLLocationCoordinate2D location = CLLocationCoordinate2DMake(40.7356, -73.9906);
[manager getProductsForLocation:location success:^(NSArray *result) {
    NSLog(@"%@", result);
} failure:^(NSError *error) {
    NSLog(@"%@", error);
}];

或者,您可以创建自己AUBRequestManager的实例,并将服务器令牌直接设置为每个管理器的值

AUBRequestManager *manager = [[AUBRequestManager alloc] initWithServerToken:@"YOUR_SERVER_TOKEN"];

CLLocationCoordinate2D location = CLLocationCoordinate2DMake(40.7356, -73.9906);
[manager getProductsForLocation:location success:^(NSArray *result) {
NSLog(@"%@", result);
} failure:^(NSError *error) {
NSLog(@"%@", error);
}];

需求

iOS 6+

作者

Tom Jowett,@tjrebase

许可

Aubergine可在MIT许可下获取。有关更多信息,请参阅LICENSE文件。