Mercurial > public > simoleon
comparison Simoleon/UI/SearchBar.swift @ 171:70f0625bfcf1
Merge pull request #17 from denniscm190/development
open source project
committer: GitHub <noreply@github.com>
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Tue, 12 Oct 2021 16:17:35 +0200 |
parents | Simoleon/Helpers/SearchBar.swift@04feeb708833 Simoleon/Helpers/SearchBar.swift@84137052813d |
children |
comparison
equal
deleted
inserted
replaced
146:f10b0e188905 | 171:70f0625bfcf1 |
---|---|
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 } |