Created
April 23, 2022 12:57
-
-
Save amosgyamfi/52d416c0c6af941dab85203c755bf422 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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