diff Simoleon/UI/CurrencySelector.swift @ 160:0c589138a6f3

Implement Conversion Box
author Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com>
date Sun, 29 Aug 2021 19:04:34 +0100
parents 35628bac01f5
children 3913aff613e8
line wrap: on
line diff
--- a/Simoleon/UI/CurrencySelector.swift	Sat Aug 28 19:18:50 2021 +0100
+++ b/Simoleon/UI/CurrencySelector.swift	Sun Aug 29 19:04:34 2021 +0100
@@ -8,10 +8,10 @@
 import SwiftUI
 
 struct CurrencySelector: View {
-    @State var currencyPair: CurrencyPairModel
+    @ObservedObject var currencyPair: CurrencyPair
     @State private var showingList = false
     @State private var modalSelection: ModalType = .allCurrencies
-    let currencyPairsSupported: [String] = try! read(json: "CurrencyPairsSupported.json")
+    let currencyPairsSupported: [String] = try! readJson(from: "CurrencyPairsSupported.json")
     
     private enum ModalType {
         case allCurrencies, compatibleCurrencies
@@ -84,6 +84,6 @@
 
 struct CurrencySelector_Previews: PreviewProvider {
     static var previews: some View {
-        CurrencySelector(currencyPair: CurrencyPairModel(baseSymbol: "USD", quoteSymbol: "EUR"))
+        CurrencySelector(currencyPair: CurrencyPair())
     }
 }