I'm trying to make an App that simulates the behavior of Calculator app from Apple. On the Calculator, when you tap = (Equals), the App reads "Result, Number.", from the main display view. How can I reproduce this behavior in SwiftUI ?
My Test Scenario:
struct ContentView: View {
@State var result = 0
var body: some View {
VStack {
Text("\(result)")
.font(.largeTitle)
.frame(height: 100)
.padding()
Spacer()
Button(action: {
self.result += 1
}, label: {
Text("Add one")
.font(.title)
.padding()
})
Button(action: {
self.result -= 1
}, label: {
Text("Minus one")
.font(.title)
.padding()
})
}
}
}
I want every time result changes, from the interaction of either Add or Minus Buttons, the VoiceOver system detects the Result changes and read the Result.