1

How do I know if the ViewController is visible again?

I tried putting the print command inside viewDidAppear. Run the app. Press the home button. Return to the app but viewDidAppera dont get executed.

i am trying to execute a code right after the app becomes visible again.

How do I do that?

Jayson Tamayo
  • 2,741
  • 3
  • 49
  • 76
  • Possible duplicate of [Handling applicationDidBecomeActive - "How can a view controller respond to the app becoming Active?"](http://stackoverflow.com/questions/3639859/handling-applicationdidbecomeactive-how-can-a-view-controller-respond-to-the) – ullstrm Oct 04 '16 at 14:43

1 Answers1

0

Use your print statement in the AppDelegate for application: WillEnterForeground OR application: didBecomeActive both of those are called at different times when the user returns to the application. Use one or the other depending on at what point you'd like to call or reference your code

KSigWyatt
  • 1,368
  • 1
  • 16
  • 33