From ea314d0326eb355a16d891576d432fa9e74ce81f Mon Sep 17 00:00:00 2001 From: certainly Date: Thu, 27 Sep 2018 11:20:32 +0800 Subject: [PATCH] fix double tap tab invalid this bug is caused by the time interval between two taps which is too small. --- Classes/View Controllers/TabBarControllerDelegate.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/View Controllers/TabBarControllerDelegate.swift b/Classes/View Controllers/TabBarControllerDelegate.swift index 751b3ef31..f0e9ac8b2 100644 --- a/Classes/View Controllers/TabBarControllerDelegate.swift +++ b/Classes/View Controllers/TabBarControllerDelegate.swift @@ -28,7 +28,7 @@ final class TabBarControllerDelegate: NSObject, UITabBarControllerDelegate { nav.transitionCoordinator?.viewController(forKey: UITransitionContextViewControllerKey.from) == nil, let root = nav.viewControllers.first as? TabNavRootViewControllerType { tapCount += 1 - DispatchQueue.main.asyncAfter(deadline: .now() + 0.17, execute: { + DispatchQueue.main.asyncAfter(deadline: .now() + 0.27, execute: { let count = self.tapCount // make sure that on the same VC that queued the tap-check