less confusing
This commit is contained in:
parent
bc9c28aa3f
commit
d4ab61f923
@ -36,8 +36,9 @@ public extension MVMCoreAlertObject {
|
||||
actions: actionsForAlert,
|
||||
isGreedy: false)
|
||||
|
||||
let alertStyle = alertJson.int32ForKey("style")
|
||||
alertObject?.alertStyle = alertStyle == 0 ? .actionSheet : .alert
|
||||
if let alertStyle = alertJson.optionalStringForKey("style") {
|
||||
alertObject?.alertStyle = UIAlertController.Style(rawValue: alertStyle)
|
||||
}
|
||||
|
||||
return alertObject
|
||||
}
|
||||
|
||||
@ -111,6 +111,6 @@ public class AlertModel: Codable {
|
||||
try container.encode(title, forKey: .title)
|
||||
try container.encode(message, forKey: .message)
|
||||
try container.encode(alertActions, forKey: .alertActions)
|
||||
try container.encode(style, forKey: .style)
|
||||
try container.encode(style.rawValueString, forKey: .style)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user