How to tell the active view controller when applicationDidBecomeActive is called?

后端 未结 6 1294
孤独总比滥情好
孤独总比滥情好 2021-02-02 12:01

I feel I am missing a trick here...

I just want to call viewDidLoad or viewDidAppear on the current active view controller when applicationDidBecomeActive gets called, s

6条回答
  •  灰色年华
    2021-02-02 13:01

    Rather than trying to keep track of which ViewController is current, you could send a NSNotification from your AppDelegate and subscribe to it in your ViewController.. That way the view controller keeps track of whether or not it needs to call viewDidAppear.

提交回复
热议问题