mirror of https://github.com/xaoxuu/ProHUD
update beta6
This commit is contained in:
parent
6596e6c971
commit
d055c5b800
|
@ -120,6 +120,7 @@ public extension Guard {
|
||||||
func pop() {
|
func pop() {
|
||||||
if displaying {
|
if displaying {
|
||||||
debug("pop")
|
debug("pop")
|
||||||
|
willDisappearCallback?()
|
||||||
displaying = false
|
displaying = false
|
||||||
view.isUserInteractionEnabled = false
|
view.isUserInteractionEnabled = false
|
||||||
self.removeFromParent()
|
self.removeFromParent()
|
||||||
|
@ -207,6 +208,12 @@ public extension Guard {
|
||||||
return self
|
return self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// 消失事件
|
||||||
|
/// - Parameter callback: 事件回调
|
||||||
|
@discardableResult func willDisappear(_ callback: (() -> Void)?) -> Guard {
|
||||||
|
willDisappearCallback = callback
|
||||||
|
return self
|
||||||
|
}
|
||||||
/// 消失事件
|
/// 消失事件
|
||||||
/// - Parameter callback: 事件回调
|
/// - Parameter callback: 事件回调
|
||||||
@discardableResult func didDisappear(_ callback: (() -> Void)?) -> Guard {
|
@discardableResult func didDisappear(_ callback: (() -> Void)?) -> Guard {
|
||||||
|
|
|
@ -13,6 +13,7 @@ public class HUDController: UIViewController {
|
||||||
/// ID标识
|
/// ID标识
|
||||||
public var identifier = String(Date().timeIntervalSince1970)
|
public var identifier = String(Date().timeIntervalSince1970)
|
||||||
|
|
||||||
|
internal var willDisappearCallback: (() -> Void)?
|
||||||
/// 消失回调
|
/// 消失回调
|
||||||
internal var disappearCallback: (() -> Void)?
|
internal var disappearCallback: (() -> Void)?
|
||||||
|
|
||||||
|
@ -39,6 +40,7 @@ public class HUDController: UIViewController {
|
||||||
// Do any additional setup after loading the view.
|
// Do any additional setup after loading the view.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public override func viewDidDisappear(_ animated: Bool) {
|
public override func viewDidDisappear(_ animated: Bool) {
|
||||||
super.viewDidDisappear(animated)
|
super.viewDidDisappear(animated)
|
||||||
disappearCallback?()
|
disappearCallback?()
|
||||||
|
|
Loading…
Reference in New Issue