update beta6

This commit is contained in:
xaoxuu 2019-08-10 00:02:27 +08:00
parent 6596e6c971
commit d055c5b800
2 changed files with 9 additions and 0 deletions

View File

@ -120,6 +120,7 @@ public extension Guard {
func pop() {
if displaying {
debug("pop")
willDisappearCallback?()
displaying = false
view.isUserInteractionEnabled = false
self.removeFromParent()
@ -207,6 +208,12 @@ public extension Guard {
return self
}
///
/// - Parameter callback:
@discardableResult func willDisappear(_ callback: (() -> Void)?) -> Guard {
willDisappearCallback = callback
return self
}
///
/// - Parameter callback:
@discardableResult func didDisappear(_ callback: (() -> Void)?) -> Guard {

View File

@ -13,6 +13,7 @@ public class HUDController: UIViewController {
/// ID
public var identifier = String(Date().timeIntervalSince1970)
internal var willDisappearCallback: (() -> Void)?
///
internal var disappearCallback: (() -> Void)?
@ -39,6 +40,7 @@ public class HUDController: UIViewController {
// Do any additional setup after loading the view.
}
public override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
disappearCallback?()