Hi,
I am having a bit of hard time to implement authenticateRequest.
From README file, first, in .Success(let request) shouldn't "let" be removed? Having it causes crashes.
Also, switch requires default case.
In the end, for some reason even if I get .Success(request) back, for some to me unknown reason, code enters in default instead on .Success. Some working example or snippet might be good to have.
Here is what I have:
heimdallr.authenticateRequest(request) {
result in
switch result {
case .Success(request):
let task = session.dataTaskWithRequest(request) {
data, response, error in
// deserialize data and see response code
}
task.resume()
case .Failure(let error):
// print error
default:
print("Why I entered here!?")`
Can you help me out here, please?
Hi, I am having a bit of hard time to implement authenticateRequest. From README file, first, in .Success(let request) shouldn't "let" be removed? Having it causes crashes. Also, switch requires default case. In the end, for some reason even if I get .Success(request) back, for some to me unknown reason, code enters in default instead on .Success. Some working example or snippet might be good to have.
Here is what I have: