Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. let testURL = URL(string: "http://www.example.com")
  2. let loginProtectionSpace = URLProtectionSpace(host: (testURL?.host)!, port: 0, protocol: testURL?.scheme, realm: nil, authenticationMethod: NSURLAuthenticationMethodHTTPDigest)
  3. let credentialTest = URLCredential(user: "foo", password: "bar", persistence: .permanent)
  4. URLCredentialStorage.shared.setDefaultCredential(credentialTest, for: loginProtectionSpace)
  5.  
  6. // Just trying to make sure that my credentialTest is really stored, but getting someCredentials = nil how so?
  7. let someCredentials = URLCredentialStorage.shared.credentials(for: loginProtectionSpace)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement