0

Issue:

enter image description here

On the top, you can see the old view and if you hold the top of the second view and move to bottom the second view disappear. I would like the second view to be overlayed on the first one. First view has a button with an action:

@IBaction func test() {
    let vc = self.storyboard!.instantiateViewController(withIdentifier: "ccc")
    self.show( vc, sender: nil )
}
Aleksey Potapov
  • 3,683
  • 5
  • 42
  • 65
aaa55
  • 3
  • 1

1 Answers1

2

Just change the modalPresentationStyle to .fullScreen.

//1
let vc = self.storyboard!.instantiateViewController(withIdentifier: "ccc")

//2
vc.modalPresentationStyle = .fullScreen

//3
self.present(vc, animated: true, completion: nil)
Lew Winczynski
  • 1,190
  • 1
  • 11
  • 20
Keshu R.
  • 5,045
  • 1
  • 18
  • 38
  • it's work thank, i can't validate answer yet but when modalPresentationStyle is not specified, xcode make a random choose ? – aaa55 Dec 27 '19 at 11:01
  • not random. its now default presentation style for iOS 13.0+ , for below version, it still shows them on fullScreen by default. – Keshu R. Dec 27 '19 at 11:02