Type Safely

Type Safely

Share this post

Type Safely
Type Safely
Create Space Between SwiftUI Views Without Using a Spacer

Create Space Between SwiftUI Views Without Using a Spacer

Daily Coding Tip 099

Millie Sturgeon's avatar
Millie Sturgeon
Jun 05, 2022
∙ Paid

Share this post

Type Safely
Type Safely
Create Space Between SwiftUI Views Without Using a Spacer
Share
Image by Francesco Cirelli from Pixabay

It’s hard to break a habit like putting a Spacer in the middle of a VStack or an HStack, adding space between two items at either end of the stack.

There is no need for this in many cases, as alignment can be used to place items in the stack independently of one another.

Keep reading with a 7-day free trial

Subscribe to Type Safely to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Type Safely
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share