When tying to display buttons instead of inactive view, get 'Contextual closure type '() -> Label' expects 0 arguments, but 1 was used in closure body' error.
enum CloudType: String, CaseIterable, Codable {
case Azure
case Google
case Amazon
}
struct ContentView: View {
let cloudTypes: [CloudType] = [.Azure, .Google, .Amazon]
var body: some View {
FlowLayout(mode: .scrollable,
items: cloudTypes.map { $0.rawValue },
itemSpacing: 4) {
Text($0)
.padding(.vertical, 8)
.padding(.horizontal, 24)
.background(RoundedRectangle(cornerRadius: 32).fill(.blue))
.foregroundColor(.white)
.font(.subheadline)
}.padding()
}
}
When tying to display buttons instead of inactive view, get 'Contextual closure type '() -> Label' expects 0 arguments, but 1 was used in closure body' error.
Example code: