Increase or decrease Int with buttons. When going from positive numbers to negative numbers or when a facto 10 is added sizeToFit cannot handle.
Solution (?) Looks like it is a discrepancy between Preview and Simulator/Device. Maybe I should file a radar instead...
struct ContentView : View { @State var totalClicked: Int = 0
var body: some View {
VStack {
HStack {
Button(action: {self.totalClicked = self.totalClicked - 1}) {
Text("decrease")
}
Button(action: {self.totalClicked = self.totalClicked + 1}) {
Text("increase")
}
}.padding()
Text("\(totalClicked)")
}
}




