1

I need to add a feature to my app to allow for creating one-time or recurring alarms/events.

There are many tutorials outlining the essentials of simply creating an alarm app, but have yet to see one that demonstrates the creation of recurring alarms.

The stock app has this functionality, is it possible replicate and add to an app? Or perhaps readily available source code?

UPDATE

I need to allow for repeating given the days of the week, ie. repeat this alarm on Monday, Wednesday and Thursday. Not simply every hour, day, week...etc

Sauron
  • 6,399
  • 14
  • 71
  • 136
  • http://useyourloaf.com/blog/repeating-an-ios-local-notification/ check this for repeat local notifications – Muhammad Adnan Apr 18 '16 at 17:16
  • @MuhammadAdnan, I need to allow for repeating given the days of the week, ie. repeat this alarm one Monday, Wednesday and Thursday. How can this be accomplished? – Sauron Apr 18 '16 at 17:19
  • 2
    like this http://stackoverflow.com/questions/15342546/how-to-set-the-repeat-uilocal-notifications-on-the-select-list-of-weekdays – Muhammad Adnan Apr 18 '16 at 17:26

1 Answers1

1

You can create local notification using UILocalNotification. The class has a property repeatInterval. This is what you are searching for.

dasdom
  • 13,975
  • 2
  • 47
  • 58
  • So I would simply have to extend the present alarm apps to set the property: `repeatInterval`, if they were to repeat every week, Monday, Wednesday, Friday? Is there a sample implementation of this? – Sauron Apr 18 '16 at 17:11
  • 1
    The word 'repeatInterval` in my answer is a link to the documentation. Everything you need to know you can finde there. – dasdom Apr 18 '16 at 17:14
  • I would like to reopen this question, in order to get away from the complex repeating logic. Would it be acceptable to simply have an alarm schedule everyday, but then contain logic to only alert the user during the days they originally set to be alerted? For example: They set an alarm to repeat only on weds, fri, sunday at 10am. So the alarm is set to repeat everyday at 10, but there is logic to filter out the days that were not chosen in the first place upon alarm ring. Thus the user will only see the alert on weds, fri, sunday, but it will be going off everyday "in the background" – Sauron May 05 '16 at 20:42