How do you combine multiple state variables to form another?
I want to change the value of height OR width by some user interaction, and have everything in the view update accordingly. So the height OR width would change, and the area would change.
I imagine it would look something like this
@State var width: CGFloat = 50.0
@State var height: CGFloat = 100.0
@State var area: CGFloat // somehow equal to width*height
current solution is just calling a func
func area() -> CGFloat {
width * height
}