stinsen icon indicating copy to clipboard operation
stinsen copied to clipboard

[Question] @Root animation

Open savage7 opened this issue 2 years ago • 5 comments

UIKit based Coordinators offered the ability to apply transition effects when replacing a root view i.e. with RxFlow you could just do this:

Flows.use(onboardingFlow, when: .ready) { [unowned self] flowRoot in
            UIView.transition(with: self.rootWindow, duration: 0.1, options: .transitionCrossDissolve, animations: {}, completion: nil)
            self.rootWindow.rootViewController = flowRoot
}

or with XCoordinator you can do: .presentFullScreen(TabCoordinator().strongRouter, animation: .fade)

Both are used to replace root views, not for a modal transition.

It would be cool if there would be basic support for this in Stinsen like: @Root(.fade) var start = makeStart

Would that be possible? I honestly didn't find a location in the code where a concrete view switch is happening which could be animated.

savage7 avatar Jan 17 '22 19:01 savage7

Sounds like something that might be a good addition. I'm thinking of adding the possibility of custom push/modals as well (for instance, if you want to push to an alert, a bottom sheet or something similar), that might be a related problem 🙂

rundfunk47 avatar Feb 02 '22 16:02 rundfunk47

Sounds like something that might be a good addition. I'm thinking of adding the possibility of custom push/modals as well (for instance, if you want to push to an alert, a bottom sheet or something similar), that might be a related problem 🙂

This would be an extremely helpful addition! This is the last type of navigation that we're having to support manually.

cpisciotta avatar Feb 04 '22 17:02 cpisciotta

@rundfunk47 Meanwhile is there any workaround now to change modal transition animation ? May be we can specify .transition(.opacity) to some view?

emartinson avatar Aug 12 '22 13:08 emartinson