EKRecurrenceRule Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/EventKit.framework |
| Availability | Available in iOS 4.0 and later. |
| Companion guide | |
| Declared in | EKRecurrenceRule.h EKTypes.h |
Overview
The EKRecurrenceRule class is used to describe the recurrence pattern for a recurring event.
After you create a recurrence rule, assign it to an event with the recurrenceRule method of EKEvent.
Recurrence rules can have an end, represented by an EKRecurrenceEnd object. The end can be based on a specific date or a maximum number of occurrences.
Tasks
Creating a Basic Recurrence Rule
Creating a Complex Recurrence Rule
Accessing Recurrence Rule Properties
-
calendarIdentifierproperty -
recurrenceEndproperty -
frequencyproperty -
intervalproperty -
firstDayOfTheWeekproperty -
daysOfTheWeekproperty -
daysOfTheMonthproperty -
daysOfTheYearproperty -
weeksOfTheYearproperty -
monthsOfTheYearproperty -
setPositionsproperty
Properties
calendarIdentifier
The identifier for the recurrence rule’s calendar. (read-only)
Availability
- Available in iOS 4.0 and later.
Declared In
EKRecurrenceRule.hdaysOfTheMonth
The days of the month associated with the recurrence rule, as an array of NSNumber objects. Values can be from 1 to 31 and from -1 to -31.This property value is valid only for recurrence rules that were initialized with specific days of the month and a frequency type of EKRecurrenceFrequencyMonthly. (read-only)
Discussion
Negative values indicate counting backwards from the end of the month.
Availability
- Available in iOS 4.0 and later.
Declared In
EKRecurrenceRule.hdaysOfTheWeek
The days of the week associated with the recurrence rule, as an array of EKRecurrenceDayOfWeek objects. This property value is valid only for recurrence rules that were initialized with specific days of the week and a frequency type of EKRecurrenceFrequencyWeekly, EKRecurrenceFrequencyMonthly, or EKRecurrenceFrequencyYearly. (read-only)
Availability
- Available in iOS 4.0 and later.
Declared In
EKRecurrenceRule.hdaysOfTheYear
The days of the year associated with the recurrence rule, as an array of NSNumber objects. Values can be from 1 to 366 and from -1 to -366. This property value is valid only for recurrence rules initialized with a frequency type of EKRecurrenceFrequencyYearly. (read-only)
Discussion
Negative values indicate counting backwards from the end of the year.
Availability
- Available in iOS 4.0 and later.
Declared In
EKRecurrenceRule.hfirstDayOfTheWeek
Indicates which day of the week the recurrence rule treats as the first day of the week. Values of 1 to 7 correspond to Sunday through Saturday. A value of 0 indicates that this property is not set for the recurrence rule. (read-only)
Availability
- Available in iOS 4.0 and later.
Declared In
EKRecurrenceRule.hfrequency
The frequency of the recurrence rule. (read-only)
Availability
- Available in iOS 4.0 and later.
See Also
Declared In
EKRecurrenceRule.hinterval
Specifies how often the recurrence rule repeats over the unit of time indicated by its frequency. For example, a recurrence rule with a frequency type of EKRecurrenceFrequencyWeekly and an interval of 2 repeats every two weeks. (read-only)
Availability
- Available in iOS 4.0 and later.
Declared In
EKRecurrenceRule.hmonthsOfTheYear
The months of the year associated with the recurrence rule, as an array of NSNumber objects. Values can be from 1 to 12. This property value is valid only for recurrence rules initialized with specific months of the year and a frequency type of EKRecurrenceFrequencyYearly. (read-only)
Availability
- Available in iOS 4.0 and later.
Declared In
EKRecurrenceRule.hrecurrenceEnd
Indicates when the recurrence rule ends. This can be represented by an end date or a number of occurrences.
Availability
- Available in iOS 4.0 and later.
Declared In
EKRecurrenceRule.hsetPositions
An array of ordinal numbers that filters which recurrences to include in the recurrence rule’s frequency. For example, a yearly recurrence rule that has a daysOfTheWeek value that specifies Monday through Friday, and a setPositions array containing 2 and -1, occurs only on the second weekday and last weekday of every year. (read-only)
Discussion
Values can be from 1 to 366 and from -1 to -366.
Negative values indicate counting backwards from the end of the recurrence rule’s frequency (week, month, or year).
Availability
- Available in iOS 4.0 and later.
Declared In
EKRecurrenceRule.hweeksOfTheYear
The weeks of the year associated with the recurrence rule, as an array of NSNumber objects. Values can be from 1 to 53 and from -1 to -53. This property value is valid only for recurrence rules initialized with specific weeks of the year and a frequency type of EKRecurrenceFrequencyYearly. (read-only)
Discussion
Negative values indicate counting backwards from the end of the year.
Availability
- Available in iOS 4.0 and later.
Declared In
EKRecurrenceRule.hInstance Methods
initRecurrenceWithFrequency:interval:daysOfTheWeek:daysOfTheMonth:monthsOfTheYear:weeksOfTheYear:daysOfTheYear:setPositions:end:
Initializes and returns a recurrence rule with a given frequency and additional scheduling information.
Parameters
- type
The frequency of the recurrence rule. Can be daily, weekly, monthly, or yearly.
- interval
The interval between instances of this recurrence. For example, a weekly recurrence rule with an interval of
2occurs every other week. Must be greater than0.- days
The days of the week that the event occurs, as an array of
EKRecurrenceDayOfWeekobjects.- monthDays
The days of the month that the event occurs, as an array of
NSNumberobjects. Values can be from1to31and from-1to-31. This parameter is only valid for recurrence rules of typeEKRecurrenceFrequencyMonthly.- months
The months of the year that the event occurs, as an array of
NSNumberobjects. Values can be from1to12. This parameter is only valid for recurrence rules of typeEKRecurrenceFrequencyYearly.- weeksOfTheYear
The weeks of the year that the event occurs, as an array of
NSNumberobjects. Values can be from1to53and from-1to-53. This parameter is only valid for recurrence rules of typeEKRecurrenceFrequencyYearly.- daysOfTheYear
The days of the year that the event occurs, as an array of
NSNumberobjects. Values can be from1to366and from-1to-366. This parameter is only valid for recurrence rules of typeEKRecurrenceFrequencyYearly.- setPositions
An array of ordinal numbers that filters which recurrences to include in the recurrence rule’s frequency. See
setPositionsfor more information.- end
The end of the recurrence rule.
Return Value
The initialized recurrence rule, or nil if invalid values are provided.
Discussion
Negative values indicate counting backwards from the end of the recurrence rule’s frequency.
Availability
- Available in iOS 4.0 and later.
Declared In
EKRecurrenceRule.hinitRecurrenceWithFrequency:interval:end:
Initializes and returns a simple recurrence rule with a given frequency, interval, and end.
Parameters
- type
The frequency of the recurrence rule. Can be daily, weekly, monthly, or yearly.
- interval
The interval between instances of this recurrence. For example, a weekly recurrence rule with an interval of
2occurs every other week. Must be greater than0.- end
The end of the recurrence rule.
Return Value
The initialized recurrence rule, or nil if invalid values are provided.
Availability
- Available in iOS 4.0 and later.
Declared In
EKRecurrenceRule.hConstants
EKRecurrenceFrequency
Defines frequencies for recurrence rules.
typedef enum {
EKRecurrenceFrequencyDaily,
EKRecurrenceFrequencyWeekly,
EKRecurrenceFrequencyMonthly,
EKRecurrenceFrequencyYearly
} EKRecurrenceFrequency;
Constants
EKRecurrenceFrequencyDailyIndicates a daily recurrence rule.
Available in iOS 4.0 and later.
Declared in
EKTypes.h.EKRecurrenceFrequencyWeeklyIndicates a weekly recurrence rule.
Available in iOS 4.0 and later.
Declared in
EKTypes.h.EKRecurrenceFrequencyMonthlyIndicates a monthly recurrence rule.
Available in iOS 4.0 and later.
Declared in
EKTypes.h.EKRecurrenceFrequencyYearlyIndicates a yearly recurrence rule.
Available in iOS 4.0 and later.
Declared in
EKTypes.h.
Days of the Week
Defines values for the days of the week.
enum {
EKSunday = 1,
EKMonday,
EKTuesday,
EKWednesday,
EKThursday,
EKFriday,
EKSaturday
};
Constants
EKSundayThe value for Sunday.
Available in iOS 4.0 and later.
Declared in
EKTypes.h.EKMondayThe value for Monday.
Available in iOS 4.0 and later.
Declared in
EKTypes.h.EKTuesdayThe value for Tuesday.
Available in iOS 4.0 and later.
Declared in
EKTypes.h.EKWednesdayThe value for Wednesday.
Available in iOS 4.0 and later.
Declared in
EKTypes.h.EKThursdayThe value for Thursday.
Available in iOS 4.0 and later.
Declared in
EKTypes.h.EKFridayThe value for Friday.
Available in iOS 4.0 and later.
Declared in
EKTypes.h.EKSaturdayThe value for Saturday.
Available in iOS 4.0 and later.
Declared in
EKTypes.h.
© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-07-17)