comparison Simoleon/Helpers/CurrencySelector.swift @ 61:84ce5e5f0381

Improved search bar in currency selector
author Dennis Concepción Martín <dennisconcepcionmartin@gmail.com>
date Tue, 27 Jul 2021 18:45:33 +0100
parents 1303c1e50843
children 2b85d6ed433e
comparison
equal deleted inserted replaced
60:7b98dd60381c 61:84ce5e5f0381
21 let currencyPairs: [String] = parseJson("CurrencyPairs.json") 21 let currencyPairs: [String] = parseJson("CurrencyPairs.json")
22 22
23 var body: some View { 23 var body: some View {
24 NavigationView { 24 NavigationView {
25 VStack { 25 VStack {
26 TextField("Search ...", text: $searchCurrency) 26 SearchBar(placeholder: "Search...", text: $searchCurrency)
27 .padding(10)
28 .background(
29 RoundedRectangle(cornerRadius: 15)
30 .foregroundColor(Color(.systemGray6))
31 )
32 .padding() 27 .padding()
33 28
34 List(searchResults, id: \.self) { currencyPair in 29 List(searchResults, id: \.self) { currencyPair in
35 Button(action: { select(currencyPair) }) { 30 Button(action: { select(currencyPair) }) {
36 CurrencyRow(currencyPair: currencyPair) 31 CurrencyRow(currencyPair: currencyPair)
37 } 32 }
38 } 33 }