Mercurial > public > simoleon
comparison Simoleon/UI/CurrencyButton.swift @ 160:0c589138a6f3
Implement Conversion Box
author | Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com> |
---|---|
date | Sun, 29 Aug 2021 19:04:34 +0100 |
parents | 84137052813d |
children |
comparison
equal
deleted
inserted
replaced
159:35628bac01f5 | 160:0c589138a6f3 |
---|---|
7 | 7 |
8 import SwiftUI | 8 import SwiftUI |
9 | 9 |
10 struct CurrencyButton: View { | 10 struct CurrencyButton: View { |
11 var selectedCurrency: String | 11 var selectedCurrency: String |
12 let currencyDetails: [String: CurrencyModel] = try! read(json: "Currencies.json") | 12 let currencyDetails: [String: CurrencyModel] = try! readJson(from: "Currencies.json") |
13 | 13 |
14 var body: some View { | 14 var body: some View { |
15 let currency = currencyDetails[selectedCurrency]! | 15 let currency = currencyDetails[selectedCurrency]! |
16 RoundedRectangle(cornerRadius: 15) | 16 RoundedRectangle(cornerRadius: 15) |
17 .foregroundColor(Color(.secondarySystemBackground)) | 17 .foregroundColor(Color(.secondarySystemBackground)) |