In first ViewController in ViewDidLoad(), there are 2 operations:
- Puts buttonGo.isEnabled = false (buttonGo is Bar Button Item)
- Makes a request, through a web service to check if the device is authorized.
To check if the device is authorized is done inside a singleton class delegate. It calls: DownloadAuthorize that has got a delegate method: updateView().
If the device is authorize, I will call back the delegate method updateView() in ViewController and this method makes buttonGo.isEnabled = true
Everything works well, but the buttonGo goes enabled after few seconds. I investigate in this way and it seems to me that the buttonGo goes to enabled by the background thread. I tried to use view.setNeedsLayout(), view.setNeedsDisplay() in delegate method, because I hoped to speed up the redraw component but I get such mistakes similar of this: "This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes"
Is it possible to do something to speed up the controls to refresh?
Thank you