iOS处理多次push的方法
class LLBaseNavigationController: UINavigationController,UIGestureRecognizerDelegate {
var _isTrasiting:Bool = false
override func viewDidLoad() {
super.viewDidLoad()
}
override func pushViewController(viewController: UIViewController, animated: Bool) {
if _isTrasiting
{
return
}
_isTrasiting = true
super.pushViewController(viewController, animated: animated)
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (Int64)(1 * NSEC_PER_SEC)), dispatch_get_main_queue()) {[weak self]() -> Void in
guard let strongSelf = self else {return}
strongSelf._isTrasiting = false
}
}
}
本文标题:iOS处理多次push的方法
本文链接:https://www.haomeiwen.com/subject/cwmlsttx.html
网友评论