SwiftUILayouts
A library of commonly requested layouts. Implemented using SwiftUI's native layout system.
NOTE: SwiftUILayouts requires iOS 16 or above, as this uses the new SwiftUI Layout system.
Why use these?
- Native SwiftUI Layouts are fast and can be safely embedded anywhere in SwiftUI views
- Each layout is self-contained within a file. Want to customise it? Just copy the code (and send us a pull request with improvements!)
Check out the demo app to see them in action
Layouts
Flow Layout
Ideal for tag lists, amongst many other uses. Lay out views horizontally, wrapping to the next line when space runs out
Waterfall Layout
Great for presenting images of varying aspect ratios. Ensures columns are filled equally while preserving order.
Credit
The flow layout code was heavily inspired by objc.io's great exploration of the new Layout system.