Mercurial > public > simoleon
comparison Simoleon/UI/SearchBar.swift @ 156:84137052813d
Refactor code
author | Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com> |
---|---|
date | Sat, 28 Aug 2021 11:15:25 +0100 |
parents | Simoleon/Helpers/SearchBar.swift@04feeb708833 |
children | 70f0625bfcf1 |
comparison
equal
deleted
inserted
replaced
155:681f2cbe8c7f | 156:84137052813d |
---|---|
1 // | |
2 // SearchBar.swift | |
3 // Simoleon | |
4 // | |
5 // Created by Dennis Concepción Martín on 27/07/2021. | |
6 // | |
7 | |
8 import SwiftUI | |
9 | |
10 struct SearchBar: View { | |
11 var placeholder: LocalizedStringKey | |
12 @Binding var text: String | |
13 | |
14 var body: some View { | |
15 TextField(placeholder, text: $text) | |
16 .disableAutocorrection(true) | |
17 .padding(10) | |
18 .background( | |
19 RoundedRectangle(cornerRadius: 15) | |
20 .foregroundColor(Color(.tertiarySystemFill)) | |
21 ) | |
22 } | |
23 } | |
24 | |
25 struct SearchBar_Previews: PreviewProvider { | |
26 static var previews: some View { | |
27 SearchBar(placeholder: "Search ...", text: .constant("")) | |
28 } | |
29 } |