Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Here's the code:

extension Alamofire.Request {
public func responseObject<T: ResponseJSONObjectSerializable> (completionHandler: (NSURLRequest?, NSHTTPURLResponse?, Result<T> -> Void) -> Self {
//Error1: expected ',' separator
//Error2: expected parameter type following ':'

    ...

)
}

I'm using Swift 2.0, Alamofire 3.0, and SwiftyJSON.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
127 views
Welcome To Ask or Share your Answers For Others

1 Answer

Problem solved: there's a mistake of parenthesis in the code, the ) should be place behind result<T> rather than the end of the function.

I thought it was some serious problem, took me a long time to find this. :P


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...