Reputation: 609
I'm trying to have a local notification that repeats daily and displays the current date. How can I achieve that?
I tried using something like
localNotification.repeatInterval = .Day
localNotification.alertBody = "currentdate: \(NSDate())"
but in that case it keeps displaying the "first fire date"
I can schedule them for the coming dates one by one but that way I am limited to 64 notifications according to the documentation.
Upvotes: 1
Views: 119
Reputation: 21726
alertBody
is just a NSString
property. So it is not computed each time notification is shown. That is why you can not show "changeable" text there.
If for some reason you need to show current "date" in the notification, try to change the displayed text to "now" or display only scheduled time there without "day" component.
Upvotes: 1