We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c569592 commit 6a0bbf8Copy full SHA for 6a0bbf8
Example/SwiftBloc/BlocContentView.swift
@@ -13,8 +13,9 @@ struct BlocContentView: View {
13
var body: some View {
14
NavigationView {
15
BlocView(builder: { (bloc) in
16
+ let isPresented = Binding.constant(bloc.state.count < -6)
17
CounterView()
- .alert(isPresented: bloc.shouldShowAlertBinding) {
18
+ .alert(isPresented: isPresented) {
19
Alert(
20
title: Text("Hi"),
21
message: Text("Message"),
Example/SwiftBloc/CounterBloc.swift
@@ -23,10 +23,6 @@ struct CounterState: Equatable {
23
}
24
25
class CounterBloc: Bloc<CounterEvent, CounterState> {
26
- var shouldShowAlertBinding: Binding<Bool> {
27
- Binding.constant(state.count < -6)
28
- }
29
-
30
init() {
31
super.init(initialState: CounterState(count: 0))
32
0 commit comments