mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-05-30 12:15:26 +08:00
22 lines
640 B
Swift
22 lines
640 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
|
|
|
|
func newGithubClient(
|
|
sessionManager: GithubSessionManager,
|
|
userSession: GithubUserSession? = nil
|
|
) -> GithubClient {
|
|
let config = URLSessionConfiguration.default
|
|
config.urlCache = nil
|
|
config.httpAdditionalHeaders = Alamofire.SessionManager.defaultHTTPHeaders
|
|
let manager = Alamofire.SessionManager(configuration: config)
|
|
return GithubClient(sessionManager: sessionManager, networker: manager, userSession: userSession)
|
|
}
|