Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change current date on sunset time #157

Closed
mohsinalimat opened this issue Dec 1, 2015 · 4 comments
Closed

change current date on sunset time #157

mohsinalimat opened this issue Dec 1, 2015 · 4 comments

Comments

@mohsinalimat
Copy link

Hello,

i want to change current date on sunset time so please help me out.

example:-
suppose today date is 01/12/2015 and next date change date on 01/12/2015 at time of 7pm.

@WenchaoD
Copy link
Owner

WenchaoD commented Dec 2, 2015

U can use UILocalNotification, and get notified in AppDelegate

    UILocalNotification *notification = [[UILocalNotification alloc] init];
    notification.fireDate = yourSunsetTime;
    notification.repeatInterval = NSCalendarUnitDay;
    [[UIApplication sharedApplication] scheduleLocalNotification:notification];

- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
{
    NSLog(@"notifify");
    // Post NSNotification to set calendar 'today'
}

@WenchaoD WenchaoD closed this as completed Dec 3, 2015
@mohsinalimat
Copy link
Author

so can we change calendar date from notification notification fire date?

@WenchaoD
Copy link
Owner

WenchaoD commented Dec 5, 2015

In application:application didReceiveLocalNotification:notification, use NSNotificationCenter to post another notification to your viewController. When you receive the NSNotification in your viewController, set calendar.today.

@mohsinalimat
Copy link
Author

ok thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@mohsinalimat @WenchaoD and others