I have a UIView ,I want it to display in a new day.For example,today I launch my app,and that UIView comes to my view,but after this,I can't see that UIView until tomorrow.
So I want to know how to judge whether it is a new day to display the UIView?
You need to register for the UIApplicationSignificantTimeChangeNotification
notification.
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(timeChange) name:UIApplicationSignificantTimeChangeNotification object:nil];
Then in the timeChange
method (or whatever you call it) update your view.
Don't forget to unregister:
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationSignificantTimeChangeNotification object:nil];
This notification is sent at midnight, if the user changes the time on their device, or the timezone changes. If your app is in the background when the change happens, it will get notified when the app returns to the foreground.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With