remove no longer necessary identifier
This commit is contained in:
parent
14dd157915
commit
a7ca1ff916
@ -64,7 +64,7 @@ public struct AlertButtonModel: Codable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct AlertModel: Codable, Identifiable, AlertModelProtocol {
|
public struct AlertModel: Codable, AlertModelProtocol {
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Properties
|
// MARK: - Properties
|
||||||
@ -75,7 +75,6 @@ public struct AlertModel: Codable, Identifiable, AlertModelProtocol {
|
|||||||
public var preferredStyle: UIAlertController.Style = .alert
|
public var preferredStyle: UIAlertController.Style = .alert
|
||||||
public var buttonModels: [AlertButtonModel]
|
public var buttonModels: [AlertButtonModel]
|
||||||
public var analyticsData: JSONValueDictionary?
|
public var analyticsData: JSONValueDictionary?
|
||||||
public var id: String
|
|
||||||
|
|
||||||
public var delegateObject: DelegateObject?
|
public var delegateObject: DelegateObject?
|
||||||
|
|
||||||
@ -100,12 +99,11 @@ 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, message: String, buttonModels: [AlertButtonModel], style: UIAlertController.Style = .alert, delegateObject: DelegateObject?) {
|
||||||
self.title = title
|
self.title = title
|
||||||
self.message = message
|
self.message = message
|
||||||
self.buttonModels = buttonModels
|
self.buttonModels = buttonModels
|
||||||
self.preferredStyle = style
|
self.preferredStyle = style
|
||||||
self.id = id
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -118,7 +116,6 @@ public struct AlertModel: Codable, Identifiable, AlertModelProtocol {
|
|||||||
case alertActions
|
case alertActions
|
||||||
case style
|
case style
|
||||||
case analyticsData
|
case analyticsData
|
||||||
case id
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -136,7 +133,6 @@ public struct AlertModel: Codable, Identifiable, AlertModelProtocol {
|
|||||||
if let style = try typeContainer.decodeIfPresent(String.self, forKey: .style) {
|
if let style = try typeContainer.decodeIfPresent(String.self, forKey: .style) {
|
||||||
self.preferredStyle = UIAlertController.Style(rawValue: style)
|
self.preferredStyle = UIAlertController.Style(rawValue: style)
|
||||||
}
|
}
|
||||||
id = try typeContainer.decodeIfPresent(String.self, forKey: .id) ?? UUID().uuidString
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func encode(to encoder: Encoder) throws {
|
public func encode(to encoder: Encoder) throws {
|
||||||
@ -146,7 +142,6 @@ public struct AlertModel: Codable, Identifiable, AlertModelProtocol {
|
|||||||
try container.encodeIfPresent(buttonModels, forKey: .alertActions)
|
try container.encodeIfPresent(buttonModels, forKey: .alertActions)
|
||||||
try container.encode(preferredStyle.rawValueString, forKey: .style)
|
try container.encode(preferredStyle.rawValueString, forKey: .style)
|
||||||
try container.encodeIfPresent(analyticsData, forKey: .analyticsData)
|
try container.encodeIfPresent(analyticsData, forKey: .analyticsData)
|
||||||
try container.encode(id, forKey: .id)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user