navigation-stack
navigation-stack copied to clipboard
[Issue] Problem when drag and release instantly, not swipe back view
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.
@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
@qhu91it hi thanks, Could you create Pull Request with a fix?