doodle911 doodle911 - 1 year ago 95
Swift Question

Extra Argument In A Call

I am in need of a solution for this error, which has only occurred when I upgraded to Xcode 8!

My code looks like this;

Alamofire.request(.GET, link).validate().responseJSON { response in

the error highlights "link" in red. it is defined further above the code;

let link = ""

The ERROR is this;

Extra Argument In A Call

Any help is greatly appreciated!!!

Answer Source

According to the document:

- Data Request - Simple with URL string

// Alamofire 3

Alamofire.request(.GET, urlString).response { request, response, data, error in

// Alamofire 4

Alamofire.request(urlString).response { response in // method defaults to `.get`

So you need to remove .GET argument

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download