Advertisement
Guest User

Untitled

a guest
Sep 1st, 2014
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. func ResetNSURLCredentials() {
  2. let protectionSpace : NSURLProtectionSpace = NSURLProtectionSpace(host: "xyz.com", port: 0, `protocol`: "http", realm: nil, authenticationMethod: nil)
  3.  
  4. for (urlProtectionSpace, users) in NSURLCredentialStorage.sharedCredentialStorage().allCredentials {
  5. for (userName, credential) in users {
  6.  
  7. while(userName == userNameEnumerator.nextObject() as NSEnumerator){
  8. NSURLCredentialStorage.sharedCredentialStorage().removeCredential(credential, forProtectionSpace: protectionSpace)
  9. }
  10. }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement