반응형

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    localNotification = [[UILocalNotification alloc] init];
    NSDate *currentDate = [NSDate date];
    localNotification.fireDate = [currentDate dateByAddingTimeInterval:60];
    localNotification.timeZone = [NSTimeZone defaultTimeZone];
    localNotification.alertAction = @"Open the App";
    localNotification.alertBody = @"Daily Reminder - Minute by Minute";
    localNotification.repeatInterval = NSMinuteCalendarUnit;
    localNotification.applicationIconBadgeNumber = 10;
   
    [[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
}


- (IBAction)stopNotifications:(id)sender {
    [[UIApplication sharedApplication] cancelLocalNotification:localNotification];
    [UIApplication sharedApplication].applicationIconBadgeNumber = (NSInteger)badgeStepper.value;
}

반응형
Posted by 컴스터
,