Creating SwiftUI views with two equal column spaces

Illustrating the importance of spaces

The easiest way to get equally distributed column spaces in SwiftUI is using frame and maxWidth for the views inside the StackViews

Before using the frame and maxWidth in an HStack in SwiftUI

Picture before using frame

After using frames in the view you can see the Text views are equally spaced in the preview.

Picture after using frame in the view

This could save your time a lot if you are a beginner in IOS development.

Cheers! Happy Coding!!

Encourage me by following and clapping. Thanks!

--

--