Files
SwiftUI/Examples/Combine using GitHub API/SwiftUI-Combine-Example/SearchUserBar.swift
2019-06-06 11:16:28 +03:00

32 lines
875 B
Swift
Executable File

import SwiftUI
struct SearchUserBar: View {
@Binding var text: String
@State var action: () -> Void
var body: some View {
ZStack {
HStack {
TextField(
$text,
placeholder: Text("Search User")
.color(Color.gray)
)
.padding([.leading, .trailing], 8)
.frame(height: 32)
.background(Color.white.opacity(0.4))
.cornerRadius(8)
Button(
action: action,
label: { Text("Search") }
)
.foregroundColor(Color.white)
}
.padding([.leading, .trailing], 16)
}
.frame(height: 64)
.background(Color.yellow)
}
}