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

[Issue] Problem when drag and release instantly, not swipe back view #20

Open
qhu91it opened this issue May 21, 2018 · 2 comments
Open

Comments

@qhu91it
Copy link

qhu91it commented May 21, 2018

I found this issue when swiping back and release instantly so it keeps in current view, and then push to a new view, navigation stack facing this issue.
Detail please see the gif.

navigationstack error

@dung00275
Copy link

@qhu91it : can fix like that:

public func navigationController(_ navigationController: UINavigationController,
                                     willShow viewController: UIViewController,
                                     animated: Bool) {

        stackDelegate?.navigationController?(navigationController, willShow: viewController, animated: animated)

        if navigationController.viewControllers.count > screens.count + 1 {
            screens.append(view.takeScreenshot())
        }
//        else
//        if navigationController.viewControllers.count == screens.count && screens.count > 0 {
//            screens.removeLast()
//        }
    }
    
    public func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) {
        stackDelegate?.navigationController?(navigationController, didShow: viewController, animated: animated)
        if navigationController.viewControllers.count == screens.count && screens.count > 0 {
            screens.removeLast()
        }
    }

in file : NavigationStack.swift from line 110

@0ber
Copy link
Contributor

0ber commented Jul 4, 2019

@qhu91it hi thanks, Could you create Pull Request with a fix?

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

No branches or pull requests

3 participants