I want to check something every time there is a new session in an iOS application.
Neither -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ nor -(void)applicationDidBecomeActive:(UIApplication *)application{ are achieving what I want here.
What do you recommend to achieve what I want? I want to keep multitasking…
You can add your object as an observer for the
UIApplicationWillEnterForegroundNotificationnotfication (or related notifications) in order for it to perform some check whenever the app enters the foreground. Using this code, you can associate the notification with a block:You are not restricted to doing all that work in your app delegate.