Reputation: 533
I am trying to build an iOS app, where when the app enters background and the user brings it to foreground, I want to display a message like "Welcome Back", Is there a way of doing that? I have read about the UILocalNotification but that is not what I want.
Upvotes: 0
Views: 494
Reputation: 869
Yes, of course. For such kind of methods you should always look in AppDelegate.m file. It has the default method:
- (void)applicationWillEnterForeground:(UIApplication *)application
{
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Welcome back!" message:@"Welcome back!" delegate:nil cancelButtonTitle:nil otherButtonTitles:nil];
[alert show];
}
Some of that kind...
Upvotes: 2
Reputation: 318794
Implement the UIApplicationDelegate applicationWillEnterForeground:
method. This is called when the app returns to the foreground.
Upvotes: 1