I'm trying to extract JSON from request so I can use it in my code. But nil
is returned(Actual string in console is And here is JSON nil
)
class ViewController: UIViewController {
var myVar: AnyObject?
override func viewDidLoad() {
super.viewDidLoad()
Alamofire.request(.GET, "http://httpbin.org/get")
.responseJSON { _, _, JSON, _ in
self.myVar = JSON
}
println("And here is JSON \(self.myVar)")
}
}
What have I to do to solve the problem ?