Skip to content

Instantly share code, notes, and snippets.

@sturdysturge
Last active January 26, 2021 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sturdysturge/b8dd0f7e551f283b82c0cd8d42fd739c to your computer and use it in GitHub Desktop.
Save sturdysturge/b8dd0f7e551f283b82c0cd8d42fd739c to your computer and use it in GitHub Desktop.
struct AquaSearchFieldView: View {
let leftLabelText: String
let placeholderText: String
@State var text = ""
var body: some View {
HStack {
Text(leftLabelText)
ZStack {
Capsule()
.foregroundColor(.white)
Capsule()
.stroke(lineWidth: 3)
.offset(y: 1)
.foregroundColor(.gray)
HStack {
Text("🔍")
.padding(.leading, 10)
TextField("\(placeholderText)", text: $text)
.font(.caption2)
.frame(maxWidth: .infinity, alignment: .leading)
}
}
.clipShape(Capsule())
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment