Add Button

How would I add a button that I then could press to add another button in SwiftUI?

  • removed -

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)") {

            }
        }
    }
}
Add Button
 
 
Q