Code Monkey home page Code Monkey logo

Comments (9)

samjoly avatar samjoly commented on July 18, 2024 4

Hi team,
I think I found a fix on NavigationStackCompat.swift.

  1. Line 27, I add @published on navigationType
    @Published private(set) var navigationType = NavigationType.push

  2. Line 61, I set navigationType before the animation
    navigationType = .push
    withAnimation(easing) {

  3. Line 71, I set navigationType before the animation
    navigationType = .pop
    withAnimation(easing) {

Let me know what you think.

Thanks

from swiftui-navigation-stack.

mustafaozhan avatar mustafaozhan commented on July 18, 2024

@matteopuc +1 I have also weird behavior with iOS 16

from swiftui-navigation-stack.

CureleaAndrei avatar CureleaAndrei commented on July 18, 2024

Hi, I am facing the same issue (on iOS 16 only). For what I can tell and tested it seems that the popped view animation is broken (it slides to right instead of left). Have you found a solution for this ?

from swiftui-navigation-stack.

mustafaozhan avatar mustafaozhan commented on July 18, 2024

I make my all animations opacity temporary as a workaround, but couldn't find a real solution yet

from swiftui-navigation-stack.

toobiz avatar toobiz commented on July 18, 2024

Setting transitionType to .none at least turns off the faulty animation. I tried to figure out what went wrong in the code but no luck.

NavigationStackView(transitionType: .none)

from swiftui-navigation-stack.

samjoly avatar samjoly commented on July 18, 2024

I tested this simple script, and it has the same issue with iOS16:
https://stackoverflow.com/questions/63782469/swiftui-how-to-have-next-and-back-animations/63782921#63782921

This thread might help:
Has the behavior of asymmetric transitions changed in SwiftUI 4 / iOS 16?
https://developer.apple.com/forums/thread/714977

from swiftui-navigation-stack.

toobiz avatar toobiz commented on July 18, 2024

@samjoly Your fix works for me. Will you create a pull request?

from swiftui-navigation-stack.

mustafaozhan avatar mustafaozhan commented on July 18, 2024

Hey hello @matteopuc & @samjoly,

Since no-one had encouraged to create the PR, I just created it from @samjoly comment. Please check if everything is fine and let's merge it in order to have it in the library 🙂

from swiftui-navigation-stack.

matteopuc avatar matteopuc commented on July 18, 2024

Thank you so much for your help guys, the bug is fixed! 🙏

from swiftui-navigation-stack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.