Merge branch 'feature/alert_object_ease_of_use' into 'develop'

update alert model initializer to match prop requirements.

### Summary
Simplify initializer.

Co-authored-by: Kyle Hedden <kyle.hedden@verizonwireless.com>

See merge request https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/-/merge_requests/956
This commit is contained in:
Pfeil, Scott Robert 2023-05-09 00:06:13 +00:00
commit 160c5cfe23
3 changed files with 11 additions and 1 deletions

View File

@ -100,7 +100,7 @@ public struct AlertModel: Codable, Identifiable, AlertModelProtocol {
// MARK: - Init
//--------------------------------------------------
public init(title: String, message: String, buttonModels: [AlertButtonModel], style: UIAlertController.Style = .alert, delegateObject: DelegateObject?, id: String = UUID().uuidString) {
public init(title: String? = nil, message: String? = nil, buttonModels: [AlertButtonModel], style: UIAlertController.Style = .alert, delegateObject: DelegateObject? = nil, id: String = UUID().uuidString) {
self.title = title
self.message = message
self.buttonModels = buttonModels

View File

@ -26,6 +26,10 @@
case action
}
public override init(with text: String) {
super.init(with: text)
}
open override func setDefaults() {
super.setDefaults()
enableClipboardActions = false

View File

@ -16,6 +16,12 @@
public var options: [String] = []
public var selectedIndex: Int?
public init(with options: [String], selectedIndex: Int? = nil) {
self.options = options
self.selectedIndex = selectedIndex
super.init(with: options.first ?? "")
}
//--------------------------------------------------
// MARK: - Validation
//--------------------------------------------------