This commit is contained in:
Kevin G Christiano 2020-07-17 16:40:03 -04:00
parent 0b7b73ba09
commit 85f37ddfe0

View File

@ -46,7 +46,7 @@ public class AlertButtonModel: Codable {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
title = try typeContainer.decode(String.self, forKey: .title)
if let style = try? typeContainer.decodeIfPresent(String.self, forKey: .style) {
if let style = try typeContainer.decodeIfPresent(String.self, forKey: .style) {
self.style = UIAlertAction.Style(rawValue: style)
}
action = try typeContainer.decodeModel(codingKey: .action)
@ -101,7 +101,7 @@ public class AlertModel: Codable {
message = try typeContainer.decode(String.self, forKey: .message)
alertActions = try typeContainer.decode([AlertButtonModel].self, forKey: .alertActions)
if let style = try? typeContainer.decodeIfPresent(String.self, forKey: .style) {
if let style = try typeContainer.decodeIfPresent(String.self, forKey: .style) {
self.style = UIAlertController.Style(rawValue: style)
}
}