Can i know in viewWillAppear that it was called after navigationController pop (back button)?

后端 未结 3 2038
感动是毒
感动是毒 2021-02-06 23:58

Say I have UIViewController A and B. User navigates from A to B with a push segue. Than user presses back button and comes to A.

Now viewWillAppear

3条回答
  •  南旧
    南旧 (楼主)
    2021-02-07 01:01

    hm, maybe you can use self.isMovingToParentViewController in viewWillAppear, see docs, if it is NO then it means the current view controller is already on the navigation stack.

提交回复
热议问题