-1

My issue occurs when changing the VC, the old VC continues to appear in the background (see screen capture). How can I fix it?

Thank you for your help.

Pranav Kasetti
  • 8,770
  • 2
  • 50
  • 71
Elk Delf
  • 5
  • 4

2 Answers2

0

The sheet presentation style appears as a card. To make it fullscreen use this.

let vc = UIViewController()
vc.modalPresentationStyle = .fullScreen //or .overFullScreen for transparency
self.present(vc, animated: true, completion: nil)
Asif Mujtaba
  • 447
  • 6
  • 17
  • And to change from storyboard to fullscreen, how's it going? The application won't use more memory knowing that the VCs stay in the background? – Elk Delf Jul 09 '20 at 09:35
  • To change from storyboard follow [this](https://stackoverflow.com/a/57546875/7808861) – Asif Mujtaba Jul 09 '20 at 10:15
0

If VC is to disappear, try to get rid of its reference - call the destructor - deinit, and then VC will be destroyed by ARC

Helpful link: Swift deinitialization and ARC

mattom
  • 62
  • 10