Having defined the requirements, let's start implementing them, splitting the implementation into auto-conclusive phases.
In the previous chapter, we implemented the app using Interface Builder to create the UI, but we mentioned that it is definitely possible to do that entirely by code.
Although Apple provides two ways to do this, either via NSLayoutConstraintss
or Visual Format Language, both are really verbose and error-prone; hence, we'll use a nice Cartography
library, which permits us to set up constraints in a declarative way without using any hardcoded strings.
Note
A description of Cartography can be found here: https://github.com/robb/Cartography.
In the same way we did for the previous apps, we create an empty Single View app, from which we remove the reference to the main storyboard and the View Controller template.
Just for the sake of a quick test, we create PrettyWeatherViewController
, showing a red background:
class PrettyWeatherViewController...