mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-06-12 00:14:44 +08:00
29 lines
651 B
Swift
29 lines
651 B
Swift
//
|
|
// Alamofire+GithubAPI.swift
|
|
// Freetime
|
|
//
|
|
// Created by Ryan Nystrom on 5/17/17.
|
|
// Copyright © 2017 Ryan Nystrom. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
import Alamofire
|
|
import Apollo
|
|
import GitHubSession
|
|
import GitHubAPI
|
|
|
|
func newGithubClient(
|
|
userSession: GitHubUserSession? = nil
|
|
) -> GithubClient {
|
|
let networkingConfigs = userSession?.networkingConfigs
|
|
let config = ConfiguredNetworkers(
|
|
token: networkingConfigs?.token,
|
|
useOauth: networkingConfigs?.useOauth
|
|
)
|
|
return GithubClient(
|
|
apollo: config.apollo,
|
|
networker: config.alamofire,
|
|
userSession: userSession
|
|
)
|
|
}
|