Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

308
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda