//
//  UIAlertActionStyle+Codable.swift
//  MVMCore
//
//  Created by Suresh, Kamlesh on 7/14/20.
//  Copyright © 2020 myverizon. All rights reserved.
//


extension UIAlertAction.Style: Codable {

    init(rawValue: String) {
        switch rawValue {
        case "default":
            self = .default
            
        case "cancel":
            self = .cancel
            
        case "destructive":
            self = .destructive
            
        default:
            self = .default
        }
    }

    var rawValueString: String {
        switch self {
        case .default:
            return "default"
            
        case .cancel:
            return "cancel"
            
        case .destructive:
            return "destructive"
            
        @unknown default:
            return "default"
        }
    }
}
