How can I modify a View after using it? E.G:
var body: some View {
Button (action: {
// Code to move button's position. self.offset(x:y:) doesn't work, Xcode says 'result of call to offset is unused'
}) {
Text("How to I alter the colour of this text?") // Change colour somewhere else in my script
.background(Color.black)
}
.frame(alignment: .leading)
}
I need to modify a View after it has been instantiated. Because everything is a View, from the .frame to the .background, shouldn't I need to reference/delete/modify/add them to the stack?
var buttoninstead of body and thenbody.colorlike something? Can you please check this?