Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

306
Views
SwiftUI: How to display a full screen view from a sheet

Currently, I have a Navigation Link within a sheet. This creates a new page inside that sheet instead of taking up the full screen. Is there a way to dismiss the sheet and then present the view on the original screen?

Original view with a button pulling up a sheet:

Button {
    userTappedItem = item
} label: {
    ...
}
.sheet(item: $userTappedItem) {
} content: { item in
    NewView(item: item)
}

NavigationLink within NewView:

NavigationLink {
    ViewIWantAsFullScreen()
} label: {
    ...
}
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Yes, this is doable. The most important bit is the delay between dismissing the sheet and presenting the full screen cover -- without this delay, the full screen cover View just replaces the sheet's content.

struct ContentView  : View {
    @State private var sheetDisplayed = false
    @State private var fullScreenDisplayed = false
    
    var body: some View {
        VStack {
            Button("Show Sheet") {
                sheetDisplayed.toggle()
            }.sheet(isPresented: $sheetDisplayed) {
                SheetView(closeAndDisplayFullScreen: {
                    sheetDisplayed = false
                    DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
                        fullScreenDisplayed = true
                    }
                    
                })
            }
        }.fullScreenCover(isPresented: $fullScreenDisplayed) {
            FullScreenView()
        }
    }
}

struct SheetView : View {
    var closeAndDisplayFullScreen : () -> Void
    
    var body: some View {
        Button("Show full screen after dismiss") {
            closeAndDisplayFullScreen()
        }
    }
}

struct FullScreenView : View {
    var body: some View {
        Text("Full screen")
    }
}
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!