Commit e29304ce by Orkhan Alikhanov

Added DialogView parameter to DialogController.shouldDismissHandler

parent 62a7d0e0
......@@ -30,7 +30,7 @@ open class DialogBuilder<T: DialogView> {
return self
}
open func shouldDismiss(handler: ((Button?) -> Bool)?) -> DialogBuilder {
open func shouldDismiss(handler: ((T, Button?) -> Bool)?) -> DialogBuilder {
controller.shouldDismissHandler = handler
return self
}
......
......@@ -37,7 +37,7 @@ open class DialogController<T: DialogView>: UIViewController {
}
open var didCancelHandler: (() -> Void)?
open var shouldDismissHandler: ((Button?) -> Bool)?
open var shouldDismissHandler: ((T, Button?) -> Bool)?
open var didTapPositiveButtonHandler: (() -> Void)?
open var didTapNegativeButtonHandler: (() -> Void)?
......@@ -66,7 +66,7 @@ open class DialogController<T: DialogView>: UIViewController {
}
open func dismiss(_ button: Button?) {
if shouldDismissHandler?(button) ?? true {
if shouldDismissHandler?(dialogView, button) ?? true {
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