Skip to content
Discussion options

You must be logged in to vote

Hi @JeromeTonnelierOgury, I think you can handle this just like you would in a regular, vanilla SwiftUI application.

At the root reducer feature level you can add a setSection action for updating the section (or you can use @BindingState, but that may be more work than necessary). Once that is done you can derive a binding to the section field:

ForEach(viewStore.binding(get: \.section, send: Feature.Action.setSection) { $section in 
  
}

This uses the initializer of ForEach that takes a binding to a collection and products a binding to each individual element (hence there $section argument).

Then you can just keep deriving bindings to smaller and smaller pieces of the state by using dyna…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@JeromeTonnelierOgury
Comment options

@JeromeTonnelierOgury
Comment options

@JeromeTonnelierOgury
Comment options

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