| 测试已测试 | ✓ |
| 语言语言 | SwiftSwift |
| 许可证 | MIT |
| 发布最后一次发布 | 2016年4月 |
| SPM支持 SPM | ✗ |
由 Khoa Pham 维护。
| pod try GithubSwift | |
| 依赖 | >= 0 |
| Tailor | ~> 2.4 |
| RxSwift | ~> 3.3 |
| Alamofire | ~> 0.5 |
| ISO8601 | >= 0 |
let _ =
Client.signInUsingWebBrowser(Server.dotComServer, scopes: [.Repository])
.flatMap { client in
return client.fetchUserRepositories()
}.subscribeNext { repositories in
repositories.forEach { print($0.name)
}
}请求描述符
let requestDescriptor: RequestDescriptor = construct {
$0.path = "repos/\(owner)/\(name)"
$0.etag = "12345"
$0.offset = 2
$0.perPage = 50
$0.parameters["param"] = "value"
$0.headers["header"] = "value"
$0.method = .PUT
}
return enqueue(requestDescriptor).map {
return Parser.one($0)
}RequestDescriptor 创建自己的请求client
.fetchUserRepositories()
.subscribeNext { repositories in
// This gets called many times depending pagination
repositories.forEach { print($0.name)
}subscribe 将多次被调用client
.fetchUserRepositories()
.toArray()
.subscribeNext { repositories: [[Repository]] in
repositories.flatMap({$0}).forEach { print($0.name)
}subscribe 一次调用就收集所有值,可以使用 toArrayGithubSwift 通过 CocoaPods 提供。要安装它,只需在 Podfile 中添加以下行
pod 'Github.swift'GithubSwift 同样通过 Carthage 提供。要安装,只需在 Cartfile 中写入
github "onmyway133/Github.swift"Khoa Pham, [email protected]
我们很愿意您为 GithubSwift 做出贡献,有关更多信息,请查看 CONTRIBUTING 文件。
GithubSwift 在 MIT 许可下提供。有关更多信息,请参阅 LICENSE 文件。