GithubKitForSample

This is a simple Github API client and UI to use in sample projects.

Requirements

Installation

You can install via Carthage.

github "marty-suzuki/GithubKitForSample"

Usage

import GithubKit

ApiSession.shared.token = "/* Your Token */"

/// - note: You can search users.
let request = SearchUserRequest(query: "marty-suzuki", after: nil)
ApiSession.shared.send(request) {
    switch $0 {
    case .success(let value):
        //
    case .failure(let error):
        //
    }
}

/// - note: You can fetch user's repositories.
let request = UserNodeRequest(id: user.id, after: nil)
ApiSession.shared.send(request) {
    switch $0 {
    case .success(let value):
        //
    case .failure(let error):
        //
    }
}

Layout

UserViewCell

user

RepositoryViewCell

repository