This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
// Adapted from: https://stackoverflow.com/questions/62102647/swiftui-hstack-with-wrap-and-dynamic-height/62103264#62103264 | |
struct WrappingHStack<Model, V>: View where Model: Hashable, V: View { | |
typealias ViewGenerator = (Model) -> V | |
var models: [Model] | |
var viewGenerator: ViewGenerator | |
var horizontalSpacing: CGFloat = 2 | |
var verticalSpacing: CGFloat = 0 |
OlderNewer