-
Notifications
You must be signed in to change notification settings - Fork 1
/
Search Bar.swift
56 lines (47 loc) · 1.32 KB
/
Search Bar.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//
// Search Bar.swift
// TikTokFavourites
//
import SwiftUI
struct Search_Bar: View {
@State private var searchText = ""
var body: some View {
HStack {
HStack {
Image(systemName: "magnifyingglass")
.foregroundColor(.gray)
Text("Try searching for something!")
.foregroundColor(.gray)
.font(.system(size: 14))
}
.padding(.vertical, 8)
.padding(.horizontal, 13)
.background(Color.white)
.cornerRadius(8)
Spacer()
Button(action: {
// Handle search button action
}) {
Text("Search")
.foregroundColor(.red)
.padding(7)
.background(Color.white)
.cornerRadius(8)
}
Button(action: {
// Handle search button action
}) {
Image(systemName: "cart")
.font(.system(size: 24))
.foregroundColor(.black)
}
}
.padding(16)
.background(Color.gray.opacity(0.1))
}
}
struct Search_Bar_Previews: PreviewProvider {
static var previews: some View {
Search_Bar()
}
}