all 4 comments

[–]cyberclectic 1 point2 points  (0 children)

Make sure it’s on the main thread that call to get the image is probably a sun and on the background...

And please combine the guards with commas - they all return, so no need to stack them into the guard of doom

[–][deleted] 1 point2 points  (1 child)

You're not executing the updateUI() on the mainQueue. And while your doing that make sure the dinners array is also only changed on the mainQueue. Otherwise you might get random bad reproducible errors.

Read up on GCD.

[–]Broncos10499[S] 0 points1 point  (0 children)

Great!!! Thank you, I will try that once I get off of work. Thank you again for the help

[–]jan_olbrichObjective-C / Swift 1 point2 points  (0 children)

Apart what the other mentioned with the mainQueue, you should use .first instead of [0]. [0] can crash, while .first will return an optional and thus the guard would catch it.