AlertController: fix dismissal by outside tap

NavigationController: fire completion callback after pushViewController
This commit is contained in:
Ilya Laktyushin 2019-06-11 19:07:43 +02:00
parent 3c4b9ccdc1
commit 7bd11013ea
2 changed files with 5 additions and 5 deletions

View File

@ -29,19 +29,15 @@ final class AlertControllerNode: ASDisplayNode {
self.topDimView = UIView()
self.topDimView.backgroundColor = dimColor
self.topDimView.isUserInteractionEnabled = false
self.bottomDimView = UIView()
self.bottomDimView.backgroundColor = dimColor
self.bottomDimView.isUserInteractionEnabled = false
self.leftDimView = UIView()
self.leftDimView.backgroundColor = dimColor
self.leftDimView.isUserInteractionEnabled = false
self.rightDimView = UIView()
self.rightDimView.backgroundColor = dimColor
self.rightDimView.isUserInteractionEnabled = false
self.containerNode = ASDisplayNode()
self.containerNode.layer.cornerRadius = 14.0
@ -81,13 +77,15 @@ final class AlertControllerNode: ASDisplayNode {
self.topDimView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.dimmingNodeTapGesture(_:))))
self.bottomDimView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.dimmingNodeTapGesture(_:))))
self.leftDimView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.dimmingNodeTapGesture(_:))))
self.rightDimView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(self.dimmingNodeTapGesture(_:))))
}
func updateTheme(_ theme: AlertControllerTheme) {
if let effectView = self.effectNode.view as? UIVisualEffectView {
effectView.effect = UIBlurEffect(style: theme.backgroundType == .light ? .light : .dark)
}
self.containerNode.backgroundColor = theme.backgroundColor
self.backgroundNode.backgroundColor = theme.backgroundColor
self.contentNode.updateTheme(theme)
}

View File

@ -818,10 +818,12 @@ open class NavigationController: UINavigationController, ContainableController,
controller.containerLayoutUpdated(containerLayout, transition: .immediate)
}
strongSelf.pushViewController(controller, animated: animated)
completion()
}
}))
} else {
strongSelf.pushViewController(controller, animated: false)
completion()
}
})
}