Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PushView/PopView define their own animation #17

Open
hoopes opened this issue Apr 15, 2020 · 5 comments
Open

PushView/PopView define their own animation #17

hoopes opened this issue Apr 15, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@hoopes
Copy link

hoopes commented Apr 15, 2020

Hi,

I may be missing something obvious, or not fully understanding the use of this library, but I'd like for different PushView and PopView (and their programmatic counterparts) to allow for overriding the default animation of the entire stack.

Is that something that is possible today? It doesn't seem to appear so from the code, where it uses withAnimation(easing). Is it recommended to create a new NavigationStackView whenever you want to change the animation style?

Thanks!

@matteopuc
Copy link
Owner

matteopuc commented Apr 26, 2020

Hi @hoopes sorry for the late response. The feature you need is not implemented yet. At the moment you can customise the transition animation for the whole navigation stack. Anyway, it's a feature I'd need myself too, but I've never been able to get the desired result.

@matteopuc matteopuc changed the title PushView/PopView define their own animation [Improvement] PushView/PopView define their own animation Apr 26, 2020
@hoopes
Copy link
Author

hoopes commented Apr 26, 2020

Great, thanks, I'll keep my eye on it.

@jemarcia
Copy link

jemarcia commented May 6, 2020

Hi, me too i keep my eye on it ! +1 ;)
And will you implement this on push function with environmentobject navigationStack ?
( navigationStack.push(MyView()) )

@matteopuc matteopuc added the enhancement New feature or request label Sep 25, 2020
@matteopuc matteopuc changed the title [Improvement] PushView/PopView define their own animation PushView/PopView define their own animation Sep 25, 2020
@FulcrumOne
Copy link

Hi!

All you have to do is to change the fragment in public enum NavigationTransition:
case custom(AnyTransition) into case custom(AnyTransition)

And case .custom(let trans) into case .custom(let push, let pop) in public struct NavigationStackView initializer. Thanks for your awesome library!

@saket
Copy link
Contributor

saket commented Aug 16, 2021

I'd love to have this too!

FWIW this library is able to use different animations: https://github.com/indieSoftware/NavigationStack#transition-animations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants