Reputation: 555
I downloaded the latest versions of xcode and alamofire to create a simple app... unfortunately it seems impossible to send out a request !
Every time I try to build the project, xcode sends me a "expected declaration" error which I don't understand.
Any ideas ? I googled for hours and couldn't find any helpful posts...
Upvotes: 0
Views: 1015
Reputation: 433
If Xcode sends you a "expected declaration" error message, you probably located Alamofire part in class declaration area.
Solution: Move Alamofire part inside some method. like viewDidLoad method.
Example:
class MyView : UIViewController {
// Not here
// Alamofire.request( ...
override func viewDidLoad() {
super.viewDidLoad()
// Here
Alamofire.request( ...
}
}
Upvotes: 2