GithubPilot alternatives and similar libraries
Based on the "API" category.
Alternatively, view GithubPilot alternatives based on common mentions on social networks and blogs.
-
Typhoon
Powerful dependency injection for Objective-C ✨✨ (https://PILGRIM.PH is the pure Swift successor to Typhoon!!)✨✨ -
Dip
Simple Swift Dependency container. Use protocols to resolve your dependencies and avoid singletons / sharedInstances! -
Telegram Vapor Bot (SDK for creating Telegram Bots in Swift)
🤖 The wrapper for the Telegram Bot API written in Swift. It's not a framework. There is no special syntax here. This is a library that implements all Telegram Bot API methods, which is available to you to work with Vapor, Smoke, Hummingbird, FlyingFox. -
Federal Data SDK
DISCONTINUED. Federal Data SDK built in the Swift programming language. Follow the link for the documentation: -
Kraken
Simple Dependency Injection container for Swift. Use protocols to resolve dependencies with easy-to-use syntax! -
PPWeatherCheck
Incorporate with CoreLocation, Cocoapods, REST APIs, Alamofire, JSON, and UI Animation to Create a Weather Check Application.
SaaSHub - Software Alternatives and Reviews
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of GithubPilot or a related project?
README
GithubPilot - Github API V3 Swifty Wrapper
This is a Swift Github API Wrapper, it could make your life a little easier if you want to make an App with Github's wonderful data.
Installation
CocoaPods
Add a Podfile
to your project, then edit it by adding:
use_frameworks!
pod 'GithubPilot', '~>1.0.3'
then, run the following command:
$ pod install
From now on you should use {Project}.xcworkspace
to open your project
Before You start
Setup Your developer applications
Go to your Github homepage, tap your avatar -> Setting, on your left choose Applications -> Developer applications, then you should tap register a new OAuth application on your top right side.
Remember you should use a custom Authorization callback URL, which will be used later, eg. FunnyGithubTest://random After registration, you could get your Client ID and Client Secret.
Setup Your Project
To allow your user to be re-directed back to your app after OAuth dance, you'll need to associate a custom URL scheme with your app.
Open your Xcode then open Info.plist of your project. copy and paste following code to your Info.plist source code.
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>your.custom.scheme(eg. FunnyGithubTest)</string>
</array>
<dict>
<array>
Usage
Authentication
First, add import GithubPilot
at the top of your AppDelegate. You could then add application(_: didFinishLaunchingWithOptions:)
with following to authenticate your client. You also should take care of scope
parameter that your client will use, refer to Github Scope
Github.setupClientID("YourClientID", clientSecret: "YourClientSecret", scope: ["user", "repo"], redirectURI: "YourCustomCallBackURL")
Github.authenticate()
Second, add following code to your AppDelegate to get Github access token
func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool
{
Github.requestAccessToken(url)
return true
}
Used in Code
Users
Get the authenticated user
if let client = Github.authorizedClient {
client.users.getAuthenticatedUser().response({ user, requestError in
if let me = user {
print(me.description)
} else {
print(requestError?.description)
}
})
}
Get a user with username
if let client = Github.authorizedClient {
client.users.getUser(username: "onevcat").response({ (githubUser, error) -> Void in
if let user = githubUser {
print(user.description)
} else {
print(error?.description)
}
})
}
Get a page of users from since
id
if let client = Github.authorizedClient {
client.users.getAllUsers("1209").response({ (httpResponse, users, requestError) -> Void in
if let response = httpResponse {
// next `since` id
print("Since :\(response)")
}
if let result = users {
for user in result {
print(user.description)
}
} else {
print(requestError?.description)
}
})
}
Repositories
Get repositories of authenticated user
if let client = Github.authorizedClient {
client.repos.getAuthenticatedUserRepos().response({ (result, error) -> Void in
if let repos = result {
print(repos.count)
for i in repos {
print(i.name)
print(i.stargazersCount)
}
}
if let requestError = error {
print(requestError.description)
}
})
}
Get a repo by repo name and repo owner name
if let client = Github.authorizedClient {
client.repos.getRepo("Yep", owner: "CatchChat").response({ (result, error) -> Void in
if let repo = result {
print(repo.name)
}
if let requestError = error {
print(requestError.description)
}
})
}
Get repos belong to a user
if let client = Github.authorizedClient {
client.repos.getRepoFrom(owner: "onevcat").response({ (nextPage, result, error) -> Void in
if let page = nextPage {
print("Next Page is \(page)")
}
if let repos = result {
print(repos.count)
for r in repos {
print(r.name)
print(r.stargazersCount)
}
}
if let requestError = error {
print(requestError.description)
}
})
}
Events
Get received events for a user
if let client = Github.authorizedClient {
client.events.getReceivedEventsForUser("someUser", page: "1").response({ (nextpage, results, error) -> Void in
if let events = results {
// New events
}
})
}
Example
You could refer to one of my project GitPocket as an example.
Credits
Future Work
There all tons of other API I haven't implementated, like Search. I will continuously make this repo better. Welcome to pull request and open issues.