When the "Add Circle" button is pressed, Circle() will be created in VStack.
Clicking "Add Function for Circle" button will add frame, trim, stroke functions to Circle(). Do you think this is possible? Edit: I added code.
Can't add it directly like a View without ForEach? As you can see, there is no Circle() on my code screen, and when I press the button, I want to create a circle on the code screen (SwiftUI file) and preview screen.
Code:
struct SampleView: View {
var body: some View {
VStack(spacing: 20) {
// Circle here....
//Circle()
Button(action: {
//Add Circle
//Circle()
}) {
Text("Add Circle")
}
Button(action: {
//Add Function
//frame, stroke, trim... etc.
}) {
Text("Add Function for Circle")
}
}
}
}

