1.前言:有一个需求:在存在视频播放器的UIViewController,当push到另外一个UIViewController时,暂停当前播放.当pop到前一个UIViewController时,销毁播放器.
2.解决:需要在UIViewController的生命周期函数中,判断是push还是pop.借助UIViewController的navigationController属性.
3.代码:
怎样在UIViewController的生命周期函数中判断是push或者是pop触发的生命周期函数
原文:http://www.cnblogs.com/Sunnyheart/p/6397215.html