Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Weather App Dark Sky API Client Updating the UI From a Background Thread

Nenad Mitrovic
Nenad Mitrovic
8,133 Points

Can we avoid DispatchQueue method?

By placing all our web methods and parser in separated classes and they get called only on specific methods in viewController?

btw this entire topic is very overwhelming, I think I'll have to watch it more than 2 times

Taylor Smith
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Taylor Smith
iOS Development Techdegree Graduate 14,153 Points

Networking is super complicated, I totally get that. DispatchQueue isn't really avoidable when it comes to it, unless you're ok with your app running slowly. You're essentially just separating lanes on the highway of your app. If you had 1 lane and a car is going 30 below the speed limit, everyone else can only go that fast. DispatchQueue opens up the highway to allow other cars to go around the slow one in their own lane. Networking is notoriously slow, that's why we want it on another highway. hope that helped!

1 Answer

Nenad Mitrovic
Nenad Mitrovic
8,133 Points

Yes, I get it. Probably when you get used to it and write more and more basically the same code it starts to write itself after some time.