Explain How Full Screen Model in SwiftUi ?
Full Screen Model in SwiftUi
You can achieve this using the .fullScreenCover modifier as in the following example:
Code Block swift import SwiftUI struct ContentView: View { @State private var isPresented = false var body: some View { Button("Present") { isPresented.toggle() } .fullScreenCover(isPresented: $isPresented) { ModalView() } } } struct ModalView: View { @Environment(\.presentationMode) var presentationMode var body: some View { Button("Dismiss") { presentationMode.wrappedValue.dismiss() } .frame(maxWidth: .infinity, maxHeight: .infinity) .background(Color.red) .foregroundColor(Color.white) .edgesIgnoringSafeArea(.all) } }
This worked for me. Thanks!