Creating our layouts with UIStackView
Now we've got the foundations all set up, let's look at how we are going to build our details page.
We have several options. One way is Autolayout, which is exceptionally powerful and will certainly give us what we need. However, there is a much simpler way we can achieve this, by using a powerful component called UIStackView
.
Stack views can lay out views that are added next to each other or on top of each other all by itself. This saves you adding constraints for the vertical spacing between labels like we did for the contact detail information.
Since stack views can also lay out objects that are next to each other and stack views can be nested, it could also take care of the two-column layout that you implemented for screens with a regular width size class. And to top it all off, you can swap the direction in which a stack view lays out its items at runtime, meaning you can change it from horizontal to vertical depending...