Mercurial > public > lazybear
comparison LazyBear/Views/Profile/Helpers/WatchlistCreatorSearchBar.swift @ 393:0a4c399170c4
Implementing WatchlistCreator
author | Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> |
---|---|
date | Sun, 02 May 2021 12:41:20 +0200 |
parents | |
children | 5f21f7c23c5e |
comparison
equal
deleted
inserted
replaced
392:13f3578def61 | 393:0a4c399170c4 |
---|---|
1 // | |
2 // WatchlistCreatorSearchBar.swift | |
3 // LazyBear | |
4 // | |
5 // Created by Dennis Concepción Martín on 2/5/21. | |
6 // | |
7 | |
8 import SwiftUI | |
9 import Introspect | |
10 | |
11 struct WatchlistCreatorSearchBar: View { | |
12 @Binding var searchedCompany: String | |
13 | |
14 var body: some View { | |
15 TextField("", text: $searchedCompany) | |
16 .introspectTextField { textField in | |
17 textField.becomeFirstResponder() | |
18 } | |
19 .padding(10) | |
20 .padding(.leading, 40) | |
21 .overlay( | |
22 Image(systemName: "magnifyingglass") | |
23 .imageScale(.large) | |
24 .opacity(0.4) | |
25 .padding(.horizontal) | |
26 ,alignment: .leading | |
27 ) | |
28 .background( | |
29 Color(.secondarySystemBackground) | |
30 .cornerRadius(10) | |
31 ) | |
32 .padding() | |
33 } | |
34 } | |
35 | |
36 struct CustomSearchBar_Previews: PreviewProvider { | |
37 static var previews: some View { | |
38 WatchlistCreatorSearchBar(searchedCompany: .constant("")) | |
39 } | |
40 } |