Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.