mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
AlertController: fix dismissal by outside tap
NavigationController: fire completion callback after pushViewController
This commit is contained in:
parent
3c4b9ccdc1
commit
7bd11013ea
@ -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)
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user