0

Yes... I'm feeling so noob asking this, but i couldn't find any solution to update a couple of UIlabels and UIimages WHILE executing viewDidAppear. I have a function that sends 4 socket to local IP addresses and depending on the result it calls another function that sets the UI. But even using breaking points in the viewDidAppear, nothing gets updated while its checking the sockets. But all got updated when the code leaves the viewDidAppear. Why??? And how to update step by step instead of all together when leaving the viewDidAppear? *I will not use sleep or timer, it will slowdown the UI feedback. Thanks....

UPDATE ... Ok after a week looking for it i just got it here:

Updating the UI Using Dispatch_Async in Swift ... Rob did a very good explanation about using dispatch to run the check in a background thread and the UI update in the main thread.

Community
  • 1
  • 1
Cilas
  • 172
  • 1
  • 14
  • Not sure I understand 100%, but do you call super in `viewDidAppear`? http://stackoverflow.com/a/28384486/1305067 – paulvs Feb 24 '17 at 19:27
  • I tried too. But was exactly the same. The UI updates only it leaves de viewDidAppear. – Cilas Feb 24 '17 at 19:29
  • Updating your question with code will help us understand better, but if you're making a network request in `viewDidAppear`, nothing will update until the network requests complete. – Naveed J. Feb 24 '17 at 19:30

0 Answers0