johnpatrickmorgan / FlowStacks

FlowStacks allows you to hoist SwiftUI navigation and presentation state into a Coordinator
MIT License
783 stars 56 forks source link

goBackToRoot with dismiss all opened sheets #44

Closed ivan-kolesov closed 1 year ago

ivan-kolesov commented 1 year ago

is it possible to dismiss all opened sheets with goBackToRoot after it? good to have the case for reset app's state to initial.

johnpatrickmorgan commented 1 year ago

Hi @ivan-kolesov! If you make the call within a withDelaysIfUnsupported closure, it should dismiss all sheets one at a time. Does that help?

ivan-kolesov commented 1 year ago

Thanks a lot. Did with

RouteSteps.withDelaysIfUnsupported(self, \.routes) {
  $0.dismiss()
  $0.goBackToRoot()
}

but when opened more than one sheets, they close one after one and after return to root with animation.