/github-api-sdk

Search a repository using the Github API.

Primary LanguageSwiftApache License 2.0Apache-2.0

Build Status codecov Platform Compatibility Compatibility License

Github API SDK

Search Github repositories by platform and organization.

This project is mainly inspired from this project

Installation

CocoaPods

Podfile

target 'DemoApp' do
  pod 'GithubAPISDK', :git => 'https://github.com/jbdtky/github-api-sdk.git'
end

Commands

$ pod install

Usage

There is 2 platforms available

  • .ios
  • .android
let instance = GithubAPISDK(
        DefaultAPIProvider(
            maximumSimultaneously: 10,
            queue: DispatchQueue.global(qos: .utility)))

instance.fetchRepositories(.ios, organization: "myorg") { result in
    switch result {
    case let .success(repositories):
        print(repositories)
    case let .failure(error):
        print(error)
    }
}

You can implement your own API provider using the protocol APIProviderProtocol and provide it to the SDK during the initialization. So it allows you to use your favorite framework like Moya, Alamofire or APIKit.

Contribution

Please feel free to submit a PR for any contribution.