Skip to content

0.55.1 to latest, challenge with bindings in view #2966

Answered by stephencelis
imfractured asked this question in Q&A
Discussion options

You must be logged in to vote

@imfractured That's a big upgrade! Did you go one step at a time and follow the migration guides?

As for how to create an ad hoc binding, the modern equivalent is documented here: https://pointfreeco.github.io/swift-composable-architecture/main/documentation/composablearchitecture/bindings/#Ad-hoc-bindings

In your case you have a lot of computation happening, so the best you can do to approximate this is with a custom property on your store:

extension StoreOf<MyFeatureName> {
  var isBaggingPresented: Bool {
    get { status == .bagging }
    set {
      if !newValue {
        send(.hideBaggingView)
      }
    }
  }
}

// ...

.fullScreenCover(isPresented: $store.isBaggingPresented) { /*…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@imfractured
Comment options

Answer selected by imfractured
Comment options

You must be logged in to vote
1 reply
@imfractured
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants