comparison Simoleon/UI/CurrencyList.swift @ 160:0c589138a6f3

Implement Conversion Box
author Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com>
date Sun, 29 Aug 2021 19:04:34 +0100
parents 8c3bbd640103
children 3913aff613e8
comparison
equal deleted inserted replaced
159:35628bac01f5 160:0c589138a6f3
10 struct CurrencyList: View { 10 struct CurrencyList: View {
11 var currencies: [String] 11 var currencies: [String]
12 @Binding var selectedCurrency: String 12 @Binding var selectedCurrency: String
13 @State private var searchCurrency = "" 13 @State private var searchCurrency = ""
14 @Environment(\.presentationMode) private var presentation 14 @Environment(\.presentationMode) private var presentation
15 let currencyDetails: [String: CurrencyModel] = try! read(json: "Currencies.json") 15 let currencyDetails: [String: CurrencyModel] = try! readJson(from: "Currencies.json")
16 16
17 var searchResults: [String] { 17 var searchResults: [String] {
18 if searchCurrency.isEmpty { 18 if searchCurrency.isEmpty {
19 return currencies.sorted() 19 return currencies.sorted()
20 } else { 20 } else {