diff --git a/Source/Actions/AlertAction.swift b/Source/Actions/AlertAction.swift index 65a4f0c0..1ef96ac7 100644 --- a/Source/Actions/AlertAction.swift +++ b/Source/Actions/AlertAction.swift @@ -66,5 +66,7 @@ public class AlertAction: NSObject { didSet { self.actionView?.enabled = self.enabled } } - var actionView: ActionCell? + var actionView: ActionCell? { + didSet { self.actionView?.enabled = self.enabled } + } } diff --git a/Source/AlertController.swift b/Source/AlertController.swift index adcab38b..566eaa2c 100644 --- a/Source/AlertController.swift +++ b/Source/AlertController.swift @@ -269,9 +269,9 @@ public class AlertController: UIViewController { self.alertView.prepareLayout() - self.alertView.setActionTappedHandler { action in - guard self.shouldDismissHandler?(action) != false else { return } - self.presentingViewController?.dismissViewControllerAnimated(true) { + self.alertView.setActionTappedHandler { [weak self] action in + guard self?.shouldDismissHandler?(action) != false else { return } + self?.presentingViewController?.dismissViewControllerAnimated(true) { action.handler?(action) } }