Skip to content

Instantly share code, notes, and snippets.

@WillBishop
Created October 22, 2019 01:42
Show Gist options
  • Save WillBishop/a9f8b024ad393f0a8cfc96cd9bc5cb56 to your computer and use it in GitHub Desktop.
Save WillBishop/a9f8b024ad393f0a8cfc96cd9bc5cb56 to your computer and use it in GitHub Desktop.
static var username: String{
return keychain.get("username")!
}
static var password: String{
return keychain.get("password")!
}
func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
completionHandler(.useCredential, URLCredential(user: NetworkManager.username, password: NetworkManager.password, persistence: .synchronizable))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment