RTRootNavigationController icon indicating copy to clipboard operation
RTRootNavigationController copied to clipboard

pop后contentViewController的didMoveToParentViewController方法不会调用

Open swsdyg opened this issue 8 years ago • 4 comments

pop后contentViewController的didMoveToParentViewController方法不会调用 是不是应该重写一下RTContainerController的didMoveToParentViewController方法

swsdyg avatar Dec 15 '16 03:12 swsdyg

这是个问题,谢谢反馈!

rickytan avatar Dec 19 '16 05:12 rickytan

层级结构变化了,这个有点难保证 willMove 和 didMove 的调用顺序

rickytan avatar Jan 16 '17 08:01 rickytan

这几天抽空试了一下,如果用系统的 UINavigationController push 一个 ContainerController,如 UITabBarController,当 pop 掉时,UITabBarController 下的 VC 也不会收到 willMove 和 didMove 的调用,我想原因就是它本来就没有从 UITabBarController 中移除,这个行为应该是对的。

另外,通过代码 push 的话,UITabBarController 的子 controller 可以收到 willMove 和 didMove,但是通过 IB 设置,并用 Segue 来 push ,子 controller 什么都收不到。

rickytan avatar May 09 '17 08:05 rickytan

我改了几块,您那边可以看一下有什么问题。我看到得didMoveToParentViewController已经和正常得导航栏一致了。 https://gist.github.com/yeniugo/d8dbfc1df6227195bfeb0a42079d4c00

yeniugo avatar Apr 28 '20 07:04 yeniugo