Jayson Tamayo Jayson Tamayo - 17 days ago 4x
Swift Question

How to know if ViewController is visible again

How do I know if the ViewController is visible again?

I tried putting the

command inside
. Run the app. Press the home button. Return to the app but
dont get executed.

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

How do I do that?


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