Secondary Views

Secondary views are one of the more interesting layout tools available in SwiftUI, to understand them first we have to recall that views have fixed sizes. To recap the process: Parent proposes a size to its child. Child decides on its size. Parent positions the child within its bounds. Secondary views are useful because of […]

Combining Stacks

In the post about stacks we looked at the individual tools of horizontal, vertical, and z-axis stacks. When used on their own they’re useful ways of laying out views along a single axis. But when used together they’re a powerful way of creating even the most complicated layouts. Let’s continue our example of a character […]

Flexible Frames

In my first post I showed that in SwiftUI views choose their own sizes, derived from the size of their content, but that that they can be flexible about what size they choose based on the size proposed by their parent. In the post about stacks we showed that the size chosen by a stack […]


In this post I’ll discuss how alignments work in SwiftUI, building our understanding of how they function, and finishing by demonstrating how to create your own custom alignments for specific needs. Let’s start by taking a simple view that lays out horizontally three images of different heights: If you haven’t read my post about stacks, […]


The three most important layout tools in your SwiftUI toolbox are the three kinds of stacks: horizontal, vertical, and z-axis (yes, there really is no good adjective for this one). These views are parents to multiple children, and in order to fully understand how these lay them out, you should first understand that views choose […]

Views Choose Their Own Sizes

One of the first things presented about SwiftUI is that its views choose their own sizes, and that once chosen, those choices cannot be overridden. This is such a simple statement that it’s easy to move on quickly to get to the good stuff. This is a mistake, because it’s deceptive in its simplicity; this […]