import SwiftUI struct ContentView: View { @State private var isShowingFullScreenFlow = false var body: some View { TabView { Tab("Home", systemImage: "house") { TabContentView( title: "Home", message: "This is the first tab.", presentFullScreenFlow: presentFullScreenFlow ) } Tab("Settings", systemImage: "gearshape") { TabContentView( title: "Settings", message: "This is the second tab.", presentFullScreenFlow: presentFullScreenFlow ) } } .fullScreenCover(isPresented: $isShowingFullScreenFlow) { FullScreenFlow() } } private func presentFullScreenFlow() { isShowingFullScreenFlow = true } } private struct TabContentView: View { let title: LocalizedStringKey let message: LocalizedStringKey let presentFullScreenFlow: () -> Void var body: some View { VStack(spacing: 16) { Text(title) .font(.largeTitle.bold()) Text(message) .foregroundStyle(.secondary) Button("Present Full Screen", action: presentFullScreenFlow) .buttonStyle(.borderedProminent) } .padding() } } private struct FullScreenFlow: View { @Environment(\.dismiss) private var dismiss var body: some View { Group { NavigationStack { VStack(spacing: 16) { Image(systemName: "rectangle.portrait.and.arrow.forward") .font(.largeTitle) .foregroundStyle(.tint) Text("Full-screen content") .font(.title2.bold()) NavigationLink("Open Details") { FullScreenDetailView() } .buttonStyle(.bordered) } .padding() .navigationTitle("New Item") .toolbarTitleDisplayMode(.inlineLarge) .toolbar { ToolbarItem(placement: .cancellationAction) { Button(action: dismiss.callAsFunction) { Image(systemName: "xmark") } .buttonStyle(.plain) } ToolbarItem(placement: .primaryAction) { Button(action: dismiss.callAsFunction) { Image(systemName: "checkmark") } .buttonStyle(.plain) } } } } } } private struct FullScreenDetailView: View { var body: some View { Text("Detail content") .navigationTitle("Details") .navigationBarTitleDisplayMode(.inline) } } #Preview { ContentView() }