测试已验证 | ✓ |
语言语言 | SwiftSwift |
许可协议 | MIT |
发布最后发布 | 2016年3月 |
SPM支持 SPM | ✗ |
由 Creatubbles,JakubJankowski,Michal Miedlarz 维护。
依赖 | |
p2.OAuth2 | ~> 2.2 |
Alamofire | ~> 3.0 |
ObjectMapper | ~> 1.1 |
XCGLogger | ~> 3.2 |
RealmSwift | = 0.98.3 |
CreatubblesAPIClient 是一个简单的库,可帮助您与最新的 Creatubbles API 通信。它支持 Swift 和 Objective-C。
请注意,该库仍在大力开发中,界面可能会略有变化。
CreatubblesAPIClient 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中
use_frameworks!
pod 'CreatubblesAPIClient'
import CreatubblesAPIClient
let settings = CreatubblesAPIClientSettings(appId: "YOUR_APP_ID", appSecret: "YOUR_APP_SECRET")
let client = CreatubblesAPIClient(settings: settings)
client.login("username", password: "password")
{
(error) -> (Void) in
if error != nil
{
print("Wohoo! We're authorized!")
}
}
使用带下划线前缀的方法使用 Objective-C 进行通信
import CreatubblesAPIClient;
CreatubblesAPIClientSettings *settings = [[CreatubblesAPIClientSettings alloc] initWithAppId:@"YOUR_APP_ID" appSecret:@"YOUR_APP_SECRET"];
CreatubblesAPIClient *client = [[CreatubblesAPIClient alloc] initWithSettings:settings];
[client _login:@"username" password:@"password" completion:
^(NSError* error)
{
if(!error)
{
NSLog(@"Wohoo! We're authorized from Objective-C code!");
}
}];
您可以在自己的 Objective-C 项目中使用我们自己的 CTAPIClient 包装器。您可以在此处检查它 here
要获取您的 AppId 和 AppSecret,请联系我们:[email protected]
CreatubblesAPIClient 在 MIT 许可协议 下提供。