Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//
// HeaderView.swift
// iMessageClone
//
//
import SwiftUI
struct HeaderView: View {
let accentPrimary = Color(#colorLiteral(red: 0.03921568627, green: 0.5176470588, blue: 1, alpha: 1))
@State private var searchText = ""
var body: some View {
NavigationView{
Text("Searching for \(searchText)?")
.searchable(text: $searchText)
.navigationTitle("Messages")
.navigationBarTitleDisplayMode(.inline)
.navigationBarItems(
leading: Button {
print("Pressed edit button")
} label: {
Text("Edit")
},
trailing: Button {
print("Pressed compose button")
} label: {
Image(systemName: "square.and.pencil")
}
)
}
.frame(height: 80)
}
}
struct HeaderView_Previews: PreviewProvider {
static var previews: some View {
HeaderView()
.preferredColorScheme(.dark)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment