swift - alamofire throws "expected declaration" error -


i downloaded latest versions of xcode , alamofire create simple app... unfortunately seems impossible send out request !

every time try build project, xcode sends me "expected declaration" error don't understand.

any ideas ? googled hours , couldn't find helpful posts...

if xcode sends "expected declaration" error message, located alamofire part in class declaration area.

solution: move alamofire part inside method. viewdidload method.

example:

class myview : uiviewcontroller {      // not here      // alamofire.request( ...       override func viewdidload() {         super.viewdidload()          // here         alamofire.request( ...      } } 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -