A flex layout (like CSS flex) in SwiftUI with the new Layout protocol. Easy as HStack or VStack.
FlexStack {
// ...Subviews
}
FlexStack(horzontalSpacing: 12, verticalSpacing: 16) {
// ...Subviews
}Perfectly compatible with Layout animation
Same as Layout protocol limit.
Tested on iOS 16.0, *.
- Optimize for more layout options. Now
FlexStackworks best for subviews with the same ideal height.
Using SPM: Select File > Swift Packages > Add Package Dependency, then enter the URL of this page.