You can watch this episode by subscribing to Cocoacasts Plus.

Building a Weather Application From Scratch

Creating a View Model

Stop Writing Swift That Sucks

DISCLAIMER: No Rocket Science Involved

Join 20,000+ Developers Learning About Swift Development

Download the 4 Swift Patterns I Swear By

The root view controller is currently in charge of fetching weather data from the Dark Sky API. Having a view controller that performs network requests isn't uncommon if the project adopts the Model-View-Controller pattern. The current implementation of the RootViewController class isn't complicated, but that can change as the project grows and evolves. It can eventually lead to a fat and overweight view controller. That's something we absolutely want to avoid.

Instant and Unlimited Access
to 400+ Cocoacasts Tutorials

Monthly

$19 / month

Pay Once a Month
Access to Community
30 Day Money Back Guarantee

Yearly

$8.25 / month (billed annually)

Pay Once a Year and Save $129
Access to Community
30 Day Money Back Guarantee
Access to All Books

Next Episode "Parsing the JSON Response"