UIKit
is not thread safe and should only be updated from the main thread. Downloads are done on background thread, and you cannot update UI from there. Try:
override func viewDidLoad() {
super.viewDidLoad()
self.statusLabel.text = "welcome"
RemoteDataManager.getStatusUpdateFromURL { (statusData) -> Void in
let json = JSON(data: statusData)
dispatch_async(dispatch_get_main_queue()) {
self.statusLabel.text = "this does not work"
self.statusLabel.text = self.getMostRecentStatusUpdate(json) // also does not work
}
}
}