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:
commit
160c5cfe23
@ -100,7 +100,7 @@ public struct AlertModel: Codable, Identifiable, AlertModelProtocol {
|
|||||||
// MARK: - Init
|
// 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.title = title
|
||||||
self.message = message
|
self.message = message
|
||||||
self.buttonModels = buttonModels
|
self.buttonModels = buttonModels
|
||||||
|
|||||||
@ -26,6 +26,10 @@
|
|||||||
case action
|
case action
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override init(with text: String) {
|
||||||
|
super.init(with: text)
|
||||||
|
}
|
||||||
|
|
||||||
open override func setDefaults() {
|
open override func setDefaults() {
|
||||||
super.setDefaults()
|
super.setDefaults()
|
||||||
enableClipboardActions = false
|
enableClipboardActions = false
|
||||||
|
|||||||
@ -16,6 +16,12 @@
|
|||||||
public var options: [String] = []
|
public var options: [String] = []
|
||||||
public var selectedIndex: Int?
|
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
|
// MARK: - Validation
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user