Post

Replies

Boosts

Views

Activity

Reply to Add Button
you could try something simple like this: struct ContentView: View { @State private var buttons = 0 var body: some View { // the button to add other buttons Button(action: { buttons += 1 } ) { Image(systemName: "plus.circle.fill").foregroundColor(.black) } // the added buttons ForEach(0..<buttons, id: \.self) { i in Button("button \(i)") { } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’21