Reputation: 1221
i have an app that allows the users to make a phone call, when the user click on a button on my app, i open the phone app, then the user may or may not call. in any cases, the user will (should) come back to my app, in that case, i want to do some processing. i would like to know which function suites my need the best.
as i read in other ansewrs, sounds like i have to:
but i am not sure
i need your help to prove my think
thanks
Upvotes: 0
Views: 761
Reputation: 4854
AppDelegate methods are of course the reasonable choice, but with the methods, I would suggest using:
applicationWillResignActive()
as the method before you enter from your app to multitasking window OR to the background. applicationWillEnterForeground()
will only fire up when you will hit the background, but won't take the multitasking fraction with you.applicationDidBecomeActive()
as the method when you come back from
multitasking OR background. Same reason as before.Upvotes: 1
Reputation: 95
You should use application lifecycle functions from your AppDelegate to notify your controllers instead relying directly on view controller lifecycle.
Appropriate methods:
applicationDidEnterBackground:
- called just after your app goes to the background
applicationWillEnterForeground:
- called just before it will go foreground again (it will be called on app launch too so this is a place which you should double check!)
Upvotes: 0