2

When I use 3D Touch to Peek and Pop a view controller, my app UIApplication.shared.delegate?.window??.rootViewController is retained by Apple _UIFullScreenPresentationController

So if I switch the rootViewController, the old one is never released.

I made a demo app to help understanding : https://github.com/rapinto/PeekAndPopLeak

step to reproduce :

  • 3d touch on the background of the root ViewController to push a new ViewController.
  • Press the button to swich the app rootViewController
  • Open the Debug Memory Graph Xcode tool : there are now 2 living ViewController
  • Optional : if you repeat step 1 to 3, more ViewController are leaked

Unregistering the previewing context doesn't solve it.

enter image description hereenter image description here

Anyone can help me?

PS: If you don't peek and pop to push the second ViewController, rootViewController isn't retained/leaked

Raphaël Pinto
  • 653
  • 8
  • 20

0 Answers0