如何获得InteractivePopGestureRecognizer和arrow pop之间的区别

时间:2019-06-06 19:34:55

标签: ios swift

当用户使用滑动手势(UIViewController)弹出interactivePopGestureRecognizer或在navigationController上默认返回按钮上按下时,我想记录分析。我找到一种方法来检测用户何时使用滑动手势:

extension AppCoordinator: UINavigationControllerDelegate {
    func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) {
        if let coordinator = navigationController.topViewController?.transitionCoordinator {
            coordinator.notifyWhenInteractionChanges(handleInteraction)
        }
    }

    func handleInteraction(context: UIViewControllerTransitionCoordinatorContext) {
        guard !context.isCancelled else {
            return
        }
       //LOG EVENT HERE
    }
}

那后退按钮呢?

0 个答案:

没有答案