Matteo Villa Matteo Villa - 2 months ago 10
iOS Question

I can not make a sample request with Alamofire

I just installed Alamofire 3.0 with swift 2.2 and xcode 7.3.1
but when I try to make the request as in the example at:

https://github.com/Alamofire/Alamofire

xcode says this:

Expected Declaration
I can not understand why
...

Answer

You have your request outside a function. Put it inside a function or in viewDidLoad and it will work for you.