Code: Select all
struct NotificationMenuButton: View {
var body: some View {
Menu {
NavigationLink(
destination: NotificationSettingScreen()
.toolbar(.hidden, for: .tabBar)
) {
Text("Notification Settings")
}
} label: {
Label("Options", systemImage: "ellipsis.circle")
}
}
}
Code: Select all
struct NotificationScreen: View {
@EnvironmentObject private var notificationVM: NotificationViewModel
var body: some View {
NavigationStack {
NotificationMenuButton()
}
}
}
Code: Select all
import SwiftUI
struct MainScreen: View {
@State private var selectedTabIdx = 1
var body: some View {
TabView(selection: $selectedTabIdx) {
NotificationScreen()
.tabItem {
Label(
"Notifications",
systemImage: hasUnreadNotifications
? "bell.badge.fill"
: "bell"
)
}
.tag(1)
}
}
}
Mobile version