Skip to content

Instantly share code, notes, and snippets.

@fespinoza
Created January 13, 2026 09:24
Show Gist options
  • Select an option

  • Save fespinoza/3323ff0f6789e08dceaf6f94131156f6 to your computer and use it in GitHub Desktop.

Select an option

Save fespinoza/3323ff0f6789e08dceaf6f94131156f6 to your computer and use it in GitHub Desktop.
An example of how the navigation bar would collapse in iOS 26
import SwiftUI
struct HelloNavBarOverflow: View {
var body: some View {
Text("Hello, World!")
.toolbar {
ToolbarItem(placement: .topBarLeading) {
Text("Hola Mundo")
.frame(width: 300)
.background(Color.red.opacity(0.2))
}
ToolbarItemGroup(placement: .topBarTrailing) {
// HStack(spacing: 4) {
notificationButton
profileButton
// }
}
}
}
var profileButton: some View {
Button(action: {}) {
Label("Profile", systemImage: "person.circle")
}
}
var notificationButton: some View {
Button(action: {}) {
Label("Notifications", systemImage: "bell")
}
}
}
#Preview {
NavigationStack {
HelloNavBarOverflow()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment