Slide 40
Slide 40 text
struct TwoCountersView: View {
let store: Store
var body: some View {
Form {
Section(header: Text(template: readMe, .caption)) {
HStack {
Text("Counter 1")
CounterView(
store: self.store.scope(state: { $0.counter1 }, action: TwoCountersAction.counter1)
)
.buttonStyle(BorderlessButtonStyle())
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .trailing)
}
HStack {
Text("Counter 2")
CounterView(
store: self.store.scope(state: { $0.counter2 }, action: TwoCountersAction.counter2)
)
.buttonStyle(BorderlessButtonStyle())
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .trailing)
}
}
}
.navigationBarTitle("Two counter demo")
}
}