TestsTested | ✓ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Apr 2016 |
SPMSupports SPM | ✗ |
Maintained by Khoa Pham.
Depends on: | |
Tailor | >= 0 |
RxSwift | ~> 2.4 |
Alamofire | ~> 3.3 |
ISO8601 | ~> 0.5 |
Construction | >= 0 |
let _ =
Client.signInUsingWebBrowser(Server.dotComServer, scopes: [.Repository])
.flatMap { client in
return client.fetchUserRepositories()
}.subscribeNext { repositories in
repositories.forEach { print($0.name)
}
}
Make your own request using RequestDescriptor
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)
}
subscribe
gets called many times if there is paginationclient
.fetchUserRepositories()
.subscribeNext { repositories in
// This gets called many times depending pagination
repositories.forEach { print($0.name)
}
toArray
if we want subscribe
to be called once with all the values collectedclient
.fetchUserRepositories()
.toArray()
.subscribeNext { repositories: [[Repository]] in
repositories.flatMap({$0}).forEach { print($0.name)
}
GithubSwift is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'Github.swift'
GithubSwift is also available through Carthage. To install just write into your Cartfile:
github "onmyway133/Github.swift"
Khoa Pham, [email protected]
We would love you to contribute to GithubSwift, check the CONTRIBUTING file for more info.
GithubSwift is available under the MIT license. See the LICENSE file for more info.