Leaking views when changing rootViewController inside transitionWithView

前端 未结 5 1721
陌清茗
陌清茗 2020-12-04 05:29

While investigating a memory leak I discovered a problem related to the technique of calling setRootViewController: inside a transition animation block:

5条回答
  •  执念已碎
    2020-12-04 06:09

    Had a similar issue. In my case I had a viewController hierarchy, and one of the child view controllers had a presented view controller. When I changed then the windows root view controller, for some reason, the presented view controller was still in the memory. So, the solution was to dismiss all view controllers before I change the windows root view controller.

提交回复
热议问题