-
Hey everyone. I am currently learning how to use Composable Architecture. Based on the knowledge acquired with the Collection of videos A tour of the Composable Architecture, I am trying to build a very simple application. The application displays Apple's frameworks on a LazyVGrid. When you tap the single framework, I would like the view to present modally with the full description of that specific framework. I've managed to build the screen: I've created structure, enum, and structure for AppState, AppAction, and AppEnvironment respectively. Now I can see two ways of displaying framework details modally. I can simply add property isSelected = false and toggle it every time I would like the details to be displayed or dismissed, and that can could be done directly from the frameworkReducer. But I would like to add the property selectedFramework to the AppState and manage from there (present modally when the value of selectedFramework is not nil/ dismiss when the value is nil. Sadly, I am not sure how to communicate with the AppState's selectedFramework property from FrameworkAction. I thought that I could use Effect, to fire off some AppAction, from FrameworkAction, but the types interfere with each other. Any suggestions lads/lasses? My code is very short so far, so If anyone would like to have look at what is going on, please go ahead, here is the link to my repository: Thank you for any help! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Quick update, I did manage to establish communication. Now I am facing another problem, and that is using .sheet to present the view modally.
link to my repository: https://github.com/jmgawecki/CAApp |
Beta Was this translation helpful? Give feedback.
-
Thanks to Thomas and Brandon. AppState and AppAction
Piece of the appReducer taking part in .sheet( method
Content of .sheet
|
Beta Was this translation helpful? Give feedback.
Thanks to Thomas and Brandon.
Solution for that issue:
AppState and AppAction
Piece of the appReducer taking part in .sheet( method