-1

It opens as a tab when switching to another view. So, as you can see in the first photo, it opens the newly opened view in this way. But I want to see it as a full screen, not as a tab as in the second photo. There is no show relationship between them as in the code I'm opening klass. When I open the LoginView idenfier in the code, it comes as a tab instead of a full screen

*Photos from the top of the phone.

First Photo

Second Photo

class ASD: UIViewController {

    @IBAction func logoutButton(_ sender: Any) {
      let mainStoryboard = UIStoryboard(name: "Main", bundle: Bundle.main)
      let vc : ViewController = mainStoryboard.instantiateViewController(withIdentifier: "LoginView") as! ViewController
        self.present(vc, animated: false, completion: nil)
    }
}
Andrew
  • 26,706
  • 9
  • 85
  • 101
  • Does this answer your question? [Presenting modal in iOS 13 fullscreen](https://stackoverflow.com/questions/56435510/presenting-modal-in-ios-13-fullscreen) – Andrew Dec 11 '19 at 13:17

1 Answers1

3

you can set modalPresentationStyle to fullscreen

@IBAction func logoutButton(_ sender: Any) {
  let mainStoryboard = UIStoryboard(name: "Main", bundle: Bundle.main)
  let vc : ViewController = mainStoryboard.instantiateViewController(withIdentifier: "LoginView") as! ViewController
    vc.modalPresentationStyle = .fullScreen // add this to your code for fullscreen presentation 
    self.present(vc, animated: false, completion: nil)
}
Keshu R.
  • 5,045
  • 1
  • 18
  • 38