Sunday, May 19, 2024
HomeiOS Developmentswiftui - iOS | Composable Structure | Current modal from root whereas...

swiftui – iOS | Composable Structure | Current modal from root whereas pushed controllers may also current at that second


Presently I’m engaged on an interest/investigation/studying undertaking with the Composable Structure.

So at present I’ve a problem that I can not discover a good answer for except I begin to use UIKit once more with a coordinator sample (or one thing related).

So pushing one thing with TCA can simply be accomplished with StackState

Recipe Record -- push -> Recipe Element View -- Push -> Ingredient Particulars

Even you probably have a number of pushed objects the basis characteristic might nonetheless obtain a deep hyperlink and simply simply add one other merchandise to the stack.

However let’s imagine for instance the Ingredient Particulars could be offered modally

Recipe Record -- push -> Recipe Element View ^^ modal ^^ Ingredient Particulars

At this second if the basis characteristic would obtain a deep hyperlink (eg push notification ‘Recipe of day’ and wish to current this modally you can’t set a presentation state with out leading to a battle of ‘two modals being offered’.

Recipe Record -- push -> Recipe Element View ^^ modal ^^ Ingredient Particulars
  |^^ Recipe element view ^^

To deal with this accurately the one means I discovered is that you’d have to undergo all of the Reducers and discover a ‘prime reducer’ which additionally must assist a presentation state.

Has anybody discovered a pleasant ‘SwiftUI solely’ answer for this?

Additionally does anybody have a pleasant answer for this if we use modules? If Recipe and Ingredient element views are each in numerous modules, and lets assume that within the ingredient particulars you may open one other recipe particulars web page with ‘recipes that use this ingredient’

Recipe Record -- push -> Recipe Element View -- Push -> Ingredient Particulars -- Push --> Recipe Element View

However for this to work with modules on this case Module Recipe and Module Components must refer to one another, which after all shouldn’t be potential.

To resolve this you would wish to create reducers within the ‘Most important app’ to hyperlink all of it collectively to forestall these dependencies to import every others.



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments