     override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
         if let controller = segue.destination as? CurrenciesTableViewController {
             controller.delegate = self
-            if let segueIdentifier = segue.identifier {
-                switch segueIdentifier {
-                case "fromCodeSegue": controller.currencyDestination = destinationType.from.rawValue
-                case "toCodeSegue": controller.currencyDestination = destinationType.to.rawValue
-                default: break
-                }
-            }
+            controller.currencyDestination = DestinationType(segue: segue.identifier)?.rawValue
         }
         hideAllNotifications()
     }

}
class AddConversionViewController: UIViewController {
    
    enum destinationType: String{
        case from
        case to
    }
    
    var conversion: ConversionModel = ConversionModel()

            return
        }
        
        guard let type = DestinationType(rawValue: d) else {
            return
        }
        
        switch type {
        case .from:
            conversion.fromCode = code
            self.fromCurrencyButton.setTitle(conversion.fromCode, for: .normal)
        case .to:
            conversion.toCode = code
            self.toCurrencyButton.setTitle(conversion.toCode, for: .normal)
        }
    }
}
