DynamicGrid
is a horizontal stack for SwiftUI which moves the elements in the next line if there is not enough space in the current line.
iOS 16+ and macOS 13+
The parameters horizontalSpacing
and verticalSpacing
are optional and default 0.
DynamicGrid(horizontalSpacing: 10, verticalSpacing: 10) {
// other views
}