Commit e29304ce by Orkhan Alikhanov

Added DialogView parameter to DialogController.shouldDismissHandler

parent 62a7d0e0
...@@ -30,7 +30,7 @@ open class DialogBuilder<T: DialogView> { ...@@ -30,7 +30,7 @@ open class DialogBuilder<T: DialogView> {
return self return self
} }
open func shouldDismiss(handler: ((Button?) -> Bool)?) -> DialogBuilder { open func shouldDismiss(handler: ((T, Button?) -> Bool)?) -> DialogBuilder {
controller.shouldDismissHandler = handler controller.shouldDismissHandler = handler
return self return self
} }
......
...@@ -37,7 +37,7 @@ open class DialogController<T: DialogView>: UIViewController { ...@@ -37,7 +37,7 @@ open class DialogController<T: DialogView>: UIViewController {
} }
open var didCancelHandler: (() -> Void)? open var didCancelHandler: (() -> Void)?
open var shouldDismissHandler: ((Button?) -> Bool)? open var shouldDismissHandler: ((T, Button?) -> Bool)?
open var didTapPositiveButtonHandler: (() -> Void)? open var didTapPositiveButtonHandler: (() -> Void)?
open var didTapNegativeButtonHandler: (() -> Void)? open var didTapNegativeButtonHandler: (() -> Void)?
...@@ -66,7 +66,7 @@ open class DialogController<T: DialogView>: UIViewController { ...@@ -66,7 +66,7 @@ open class DialogController<T: DialogView>: UIViewController {
} }
open func dismiss(_ button: Button?) { open func dismiss(_ button: Button?) {
if shouldDismissHandler?(button) ?? true { if shouldDismissHandler?(dialogView, button) ?? true {
presentingViewController?.dismiss(animated: true, completion: nil) presentingViewController?.dismiss(animated: true, completion: nil)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment