Swiftyjson: Enum case 'Success' not found in type 'Result<Any>'

Created on 27 Sep 2016  路  4Comments  路  Source: SwiftyJSON/SwiftyJSON

I am working with this code snippet below from the SwiftyJson docs and I am receiving the errors Enum case 'Success' not found in type 'Result and Enum case 'Failure' not found in type 'Result. Please help me fix this issue. I am using Swift 3.0 and SwiftyJson 3.1.0.

Alamofire.request(.GET,` url).validate().responseJSON { response in
    switch response.result {
    case .Success(let value):
        let json = JSON(value)
        print("JSON: \(json)")
    case .Failure(let error):
        print(error)
    }
}

question

Most helpful comment

Enums are lower case, so change to .success and .failure in Swift 3

All 4 comments

What version of Alamofire are you using?

Enums are lower case, so change to .success and .failure in Swift 3

Awesome @jeneumeier. Making success and failure lowercase did the trick. Thank you.

@jeneumeier nice catch, let me update README as well.

馃嵒

Was this page helpful?
0 / 5 - 0 ratings