How do I create a new calendar event based on a range of times?
Our app displays opening times, e.g "Mon: 09:00 - 11:30", in a UITableCell. When the user taps the cell, I would like it to pop up a screen which lets the user create a new calendar event for the given opening time (so e.g. repeating ever开发者_如何转开发y monday between 09:00 and 11:30). Is there a built in controller I can use, like there is for adding a contact? If so, how do I use it? If not, what should I use instead?
Apple provides a framework called EventKit for handling the calendar. You can use a class called EKEventViewController, which is not so customizable, or make your own view and interact directly with the calendar using simple EventKit methods.
There's a very good explanation + sample code at apple developer
精彩评论