Skip to content

Commit a87bc30

Browse files
committed
Added shouldDismissAutomatically flag
1 parent 0a834b7 commit a87bc30

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

NativeUI/Sources/Alert/AlertViewController.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ public final class AlertViewController: UIViewController, AlertViewDelegate {
1212

1313
private let viewModel: Alert
1414

15+
public var shouldDismissAutomatically: Bool = true
16+
1517
// MARK: - Subviews
1618

1719
private(set) lazy var alertView: AlertView = {
@@ -98,7 +100,9 @@ extension AlertViewController {
98100
let action = viewModel.actions[index]
99101
action.handler?(action)
100102
}
101-
dismiss(animated: true, completion: nil)
103+
if shouldDismissAutomatically {
104+
dismiss(animated: true, completion: nil)
105+
}
102106
}
103107
}
104108

0 commit comments

Comments
 (0)