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 | |
// | |
// 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