I'm trying to show a spinner with SVProgressHUD, and when i get a async response from a server, dismiss that hud and show another hud with the message recevied from the server.
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
SVProgressHUD.setDefaultStyle(.Custom)
SVProgressHUD.setForegroundColor(UIColor.whiteColor())
SVProgressHUD.setBackgroundColor(UIColor.clearColor())
SVProgressHUD.setDefaultMaskType(SVProgressHUDMaskType.Clear)
SVProgressHUD.show()
loadData()
}
private func loadData() {
ApiService.getData { (succeed, message) -> () in
dispatch_async(dispatch_get_main_queue(), { () -> Void in
self.dismissHud()
})
dispatch_async(dispatch_get_main_queue(), { () -> Void in
SVProgressHUD.showInfoWithStatus("I can't see this")
})
}
If i remove the code in viewDidAppear that shows the HUD i can see the message. Any ideas? Thx