Skip to content

Instantly share code, notes, and snippets.

@amosgyamfi
Created January 29, 2022 06:04
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 amosgyamfi/24d4231fd59f73b9473719ab75426c8d to your computer and use it in GitHub Desktop.
Save amosgyamfi/24d4231fd59f73b9473719ab75426c8d to your computer and use it in GitHub Desktop.
//
// HeaderView.swift
// iMessageClone
//
// Created by Amos from getstream.io on 13.12.2021.
//
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")
} label: {
Text("Edit")
},
trailing: Button {
print("Pressed edit")
} 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