Mercurial > public > simoleon
comparison 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 |
comparison
equal
deleted
inserted
replaced
159:35628bac01f5 | 160:0c589138a6f3 |
---|---|
6 // | 6 // |
7 | 7 |
8 import SwiftUI | 8 import SwiftUI |
9 | 9 |
10 struct CurrencySelector: View { | 10 struct CurrencySelector: View { |
11 @State var currencyPair: CurrencyPairModel | 11 @ObservedObject var currencyPair: CurrencyPair |
12 @State private var showingList = false | 12 @State private var showingList = false |
13 @State private var modalSelection: ModalType = .allCurrencies | 13 @State private var modalSelection: ModalType = .allCurrencies |
14 let currencyPairsSupported: [String] = try! read(json: "CurrencyPairsSupported.json") | 14 let currencyPairsSupported: [String] = try! readJson(from: "CurrencyPairsSupported.json") |
15 | 15 |
16 private enum ModalType { | 16 private enum ModalType { |
17 case allCurrencies, compatibleCurrencies | 17 case allCurrencies, compatibleCurrencies |
18 } | 18 } |
19 | 19 |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
85 struct CurrencySelector_Previews: PreviewProvider { | 85 struct CurrencySelector_Previews: PreviewProvider { |
86 static var previews: some View { | 86 static var previews: some View { |
87 CurrencySelector(currencyPair: CurrencyPairModel(baseSymbol: "USD", quoteSymbol: "EUR")) | 87 CurrencySelector(currencyPair: CurrencyPair()) |
88 } | 88 } |
89 } | 89 } |