View Protocols and Shapes
We reimplement parts of SwiftUI's layout system — starting with view protocols and shapes — to understand it better.
Episode 225 · Oct 16 2020
We explain SwiftUI's layout system by re-implementing parts of it from scratch. We start with the basic view protocols and implement fixed and flexible frames, alignment, stacks and much more.
14 Episodes · 6h09min
We reimplement parts of SwiftUI's layout system — starting with view protocols and shapes — to understand it better.
Episode 225 · Oct 16 2020
We implement fixed frames to understand how the proposed size, frame size, and content size interact.
Episode 226 · Oct 23 2020
We replicate SwiftUI's alignment types and add the alignment parameter to the fixed frame API.
Episode 227 · Oct 30 2020
We implement Text, Overlay, and Geometry Reader to measure views and display their sizes onscreen.
Episode 228 · Nov 06 2020
We replicate the behavior of flexible frames with minimum and maximum widths.
Episode 229 · Nov 13 2020
We add SwiftUI's fixed size modifier and explain how it works with text and flexible frames.
Episode 230 · Nov 20 2020
We begin the implementation of HStack, starting with support for fixed size children.
Episode 231 · Nov 27 2020
We continue with our HStack implementation to make it work with fixed and flexible views.
Episode 232 · Dec 04 2020
We add SwiftUI's custom alignment guide API and make it work with fixed frames.
Episode 233 · Dec 11 2020
We continue adding support for custom alignment to all our views, focusing in particular on HStack.
Episode 234 · Dec 18 2020
We adjust the HStack layout algorithm to work with child views of different layout priorities.
Episode 235 · Dec 24 2020
We write an automated fuzz test for our HStack implementation and uncover a subtle bug in the process.
Episode 236 · Jan 08 2021
For the final SwiftUI view in this series, we examine the layout of grid views with fixed columns.
Episode 237 · Jan 15 2021
We add support for flexible columns to our grid view implementation.
Episode 238 · Jan 22 2021