Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes required after translating code #1

Open
dimitrijemaric opened this issue Oct 26, 2017 · 1 comment
Open

Changes required after translating code #1

dimitrijemaric opened this issue Oct 26, 2017 · 1 comment

Comments

@dimitrijemaric
Copy link

CRMClient.swift file, line #144, after Xcode translated the code to latest swift version, has an issue.

  • "WWW-Authenticate" has to be replaced with "Www-Authenticate".

  • also had to access the response headers dictionary in a different way, this is what has worked for me:

         let httpResponse = response as! HTTPURLResponse;
         let authenticationHeaderDict = httpResponse.allHeaderFields as Dictionary
         let authenticationHeaderValue = authenticationHeaderDict[AnyHashable("Www-Authenticate")]
         var authenticationHeader = authenticationHeaderValue as! NSString
    
@nataliachodelski
Copy link

I ran into this - if you cast httpResponse.allHeaderFields as an NSDictionary then you can use the key "WWW-Authenticate":
(httpResponse.allHeaderFields as! NSDictionary)["WWW-Authenticate"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants