Present View full screen

I want to display the Present View in full screen.

I was a beginner even if I searched on the Internet.

Please tell me the specific code.

Accepted Reply

You can do it in Interface Builder.


Select the viewController.

In the attributes inspector (at the right): this is the down pointing arrow

look for Presentation

Replace automatic by Full screen.


Or you can do it in code:

in the viewDidload, add:

          self.modalPresentationStyle = .fullScreen

Replies

You can do it in Interface Builder.


Select the viewController.

In the attributes inspector (at the right): this is the down pointing arrow

look for Presentation

Replace automatic by Full screen.


Or you can do it in code:

in the viewDidload, add:

          self.modalPresentationStyle = .fullScreen

Are these also executable in SwiftUI?

Your question was not asking for this, and you ask in Swift section, not SwiftUI…


That's different in SwiftUI.


Example code:

struct ContentView : View {

    var body: some View {
        Text("Test")
            .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: .infinity)
            .edgesIgnoringSafeArea(.all)
    }
}


Read discussion here:

https://stackoverflow.com/questions/56733642/how-to-make-swiftui-view-fullscreen