Xojo Conferences
XDCApr2018DenverUSA
MBSSep2018MunichEurope

MBS Xojo Network Kit 1.0

EKRecurrenceRuleMB class:

Class EKRecurrenceRuleMB Inherits EKObjectMB
ComputedProperty Description As text
Sub Get()
Description of this object.
ComputedProperty calendarIdentifier As text
Sub Get()
Calendar used by this recurrence rule.
ComputedProperty firstDayOfTheWeek As integer
Sub Get()
Recurrence patterns can specify which day of the week should be treated as the first day. Possible values for this property are integers 0 and 1-7, which correspond to days of the week with Sunday = 1. Zero indicates that the property is not set for this recurrence. The first day of the week only affects the way the recurrence is expanded for weekly recurrence patterns with an interval greater than 1. For those types of recurrence patterns, the Calendar framework will set firstDayOfTheWeek to be 2 (Monday). In all other cases, this property will be set to zero. The iCalendar spec stipulates that the default value is Monday if this property is not set.
ComputedProperty frequency As EKRecurrenceRuleMB.EKRecurrenceFrequency
Sub Get()
This property designates the unit of time used to describe the recurrence pattern.
ComputedProperty interval As integer
Sub Get()
The interval of a EKRecurrenceRule is an integer value which specifies how often the recurrence rule repeats over the unit of time described by the EKRecurrenceFrequency. For example, if the EKRecurrenceFrequency is EKRecurrenceWeekly, then an interval of 1 means the pattern is repeated every week. A value of 2 indicates it is repeated every other week, 3 means every third week, and so on. The value must be a positive integer; 0 is not a valid value, and nil will be returned if the client attempts to initialize a rule with a negative or zero interval.
ComputedProperty recurrenceEnd As EKRecurrenceEndMB
Sub Set()
This property defines when the the repeating event is scheduled to end. The end date can be specified by a number of occurrences, or with an end date.
Sub Get()
Enum EKRecurrenceFrequency Daily = 0 Weekly = 1 Monthly = 2 Yearly = 3 End Enum
Sub Constructor(type as EKRecurrenceRuleMB.EKRecurrenceFrequency, interval as integer, daysOfTheWeek() as EKRecurrenceDayOfWeekMB, daysOfTheMonth() as Integer, monthsOfTheYear() as Integer, weekOfTheYear() as Integer, daysOfTheYear() as integer, setPositions() as Integer, ende as EKRecurrenceEndMB = nil)
The designated initializer. This can be used to build any kind of recurrence rule. But be aware that certain combinations make no sense and will be ignored. For example, if you pass daysOfTheWeek for a daily recurrence, they will be ignored. type The type of recurrence interval The interval. Passing zero will raise an exception. daysOfTheWeek An array of EKRecurrenceDayOfWeek objects. Valid for all recurrence types except daily. Ignored otherwise. Corresponds to the BYDAY value in the iCalendar specification. daysOfTheMonth An array of Integers ([+/-] 1 to 31). Negative numbers infer counting from the end of the month. For example, -1 means the last day of the month. Valid only for monthly recurrences. Ignored otherwise. Corresponds to the BYMONTHDAY value in the iCalendar specification. monthsOfTheYear An array of Integers (1 to 12). Valid only for yearly recurrences. Ignored otherwise. Corresponds to the BYMONTH value in the iCalendar specification. weeksOfTheYear An array of Integers ([+/1] 1 to 53). Negative numbers infer counting from the end of the year. For example, -1 means the last week of the year. Valid only for yearly recurrences. Ignored otherwise. Corresponds to the BYWEEKNO value in the iCalendar specification. daysOfTheYear An array of Integers ([+/1] 1 to 366). Negative numbers infer counting from the end of the year. For example, -1 means the last day of the year. Valid only for yearly recurrences. Ignored otherwise. Corresponds to the BYYEARDAY value in the iCalendar specification. setPositions An array of Integers ([+/1] 1 to 366). Used at the end of recurrence computation to filter the list to the positions specified. Negative numbers indicate starting at the end, i.e. -1 indicates taking the last result of the set. Valid when daysOfTheWeek, daysOfTheMonth, monthsOfTheYear, weeksOfTheYear, or daysOfTheYear is passed. Ignored otherwise. Corresponds to the BYSETPOS value in the iCalendar specification. end The recurrence end, or nil.
Sub Constructor(type as EKRecurrenceRuleMB.EKRecurrenceFrequency, interval as integer, ende as EKRecurrenceEndMB = nil)
Simple initializer to create a recurrence. This is used to create a simple recurrence with a specific type, interval and end. If interval is 0, an exception is raised. The end parameter can be nil.
Sub Constructor(Handle as Integer, Retain as Boolean)
Create from Handle
Shared Function RecurrenceRule(type as EKRecurrenceRuleMB.EKRecurrenceFrequency, interval as integer, daysOfTheWeek() as EKRecurrenceDayOfWeekMB, daysOfTheMonth() as Integer, monthsOfTheYear() as Integer, weekOfTheYear() as Integer, daysOfTheYear() as integer, setPositions() as Integer, ende as EKRecurrenceEndMB = nil) As EKRecurrenceRuleMB
Creates a recurrence. This can be used to build any kind of recurrence rule. But be aware that certain combinations make no sense and will be ignored. For example, if you pass daysOfTheWeek for a daily recurrence, they will be ignored. type The type of recurrence interval The interval. Passing zero will raise an exception. daysOfTheWeek An array of EKRecurrenceDayOfWeek objects. Valid for all recurrence types except daily. Ignored otherwise. Corresponds to the BYDAY value in the iCalendar specification. daysOfTheMonth An array of Integers ([+/-] 1 to 31). Negative numbers infer counting from the end of the month. For example, -1 means the last day of the month. Valid only for monthly recurrences. Ignored otherwise. Corresponds to the BYMONTHDAY value in the iCalendar specification. monthsOfTheYear An array of Integers (1 to 12). Valid only for yearly recurrences. Ignored otherwise. Corresponds to the BYMONTH value in the iCalendar specification. weeksOfTheYear An array of Integers ([+/1] 1 to 53). Negative numbers infer counting from the end of the year. For example, -1 means the last week of the year. Valid only for yearly recurrences. Ignored otherwise. Corresponds to the BYWEEKNO value in the iCalendar specification. daysOfTheYear An array of Integers ([+/1] 1 to 366). Negative numbers infer counting from the end of the year. For example, -1 means the last day of the year. Valid only for yearly recurrences. Ignored otherwise. Corresponds to the BYYEARDAY value in the iCalendar specification. setPositions An array of Integers ([+/1] 1 to 366). Used at the end of recurrence computation to filter the list to the positions specified. Negative numbers indicate starting at the end, i.e. -1 indicates taking the last result of the set. Valid when daysOfTheWeek, daysOfTheMonth, monthsOfTheYear, weeksOfTheYear, or daysOfTheYear is passed. Ignored otherwise. Corresponds to the BYSETPOS value in the iCalendar specification. end The recurrence end, or nil.
Shared Function RecurrenceRule(type as EKRecurrenceRuleMB.EKRecurrenceFrequency, interval as integer, ende as EKRecurrenceEndMB = nil) As EKRecurrenceRuleMB
Creates a recurrence. This is used to create a simple recurrence with a specific type, interval and end. If interval is 0, an exception is raised. The end parameter can be nil.
Function copy() As EKRecurrenceRuleMB
Copy function for NSCopying protocol
Function daysOfTheMonth() As Integer()
This property is valid for rules whose EKRecurrenceFrequency is EKRecurrenceFrequencyMonthly, and that were initialized with one or more specific days of the month (not with a day of the week and week of the month). This property can be accessed as an array containing one or more NSNumbers corresponding to the days of the month the event recurs. For all other EKRecurrenceRules, this property is nil. This property corresponds to BYMONTHDAY in the iCalendar specification.
Function daysOfTheWeek() As Integer()
This property is valid for rules whose EKRecurrenceFrequency is EKRecurrenceFrequencyWeekly, EKRecurrenceFrequencyMonthly, or EKRecurrenceFrequencyYearly. This property can be accessed as an array containing one or more EKRecurrenceDayOfWeek objects corresponding to the days of the week the event recurs. For all other EKRecurrenceRules, this property is nil. This property corresponds to BYDAY in the iCalendar specification.
Function daysOfTheYear() As Integer()
This property is valid for rules whose EKRecurrenceFrequency is EKRecurrenceFrequencyYearly. This property can be accessed as an array containing one or more NSNumbers corresponding to the days of the year the event recurs. For all other EKRecurrenceRules, this property is nil. This property corresponds to BYYEARDAY in the iCalendar specification. It should contain values between 1 to 366 or -366 to -1.
Function monthsOfTheYear() As Integer()
This property is valid for rules whose EKRecurrenceFrequency is EKRecurrenceFrequencyYearly. This property can be accessed as an array containing one or more NSNumbers corresponding to the months of the year the event recurs. For all other EKRecurrenceRules, this property is nil. This property corresponds to BYMONTH in the iCalendar specification.
Function setPositions() As Integer()
This property is valid for rules which have a valid daysOfTheWeek, daysOfTheMonth, weeksOfTheYear, or monthsOfTheYear property. It allows you to specify a set of ordinal numbers to help choose which objects out of the set of selected events should be included. For example, setting the daysOfTheWeek to Monday-Friday and including a value of -1 in the array would indicate the last weekday in the recurrence range (month, year, etc). This value corresponds to the iCalendar BYSETPOS property.
Function weeksOfTheYear() As Integer()
This property is valid for rules whose EKRecurrenceFrequency is EKRecurrenceFrequencyYearly. This property can be accessed as an array containing one or more NSNumbers corresponding to the weeks of the year the event recurs. For all other EKRecurrenceRules, this property is nil. This property corresponds to BYWEEK in the iCalendar specification. It should contain integers from 1 to 53 or -1 to -53.
Note "About"
Represents how an event repeats. This class describes the recurrence pattern for a repeating event. The recurrence rules that can be expressed are not restricted to the recurrence patterns that can be set in Calendar's UI. It is currently not possible to directly modify a EKRecurrenceRule or any of its properties. This functionality is achieved by creating a new EKRecurrenceRule, and setting an event to use the new rule. When a new recurrence rule is set on an EKEvent, that change is not saved until the client has passed the modified event to EKEventStore's saveEvent: method.
Note "Copyright"
© 2015 by Christian Schmitz, Monkeybread Software This is part of the MBS Xojo Event Kit for iOS http://www.monkeybreadsoftware.de/xojo/
Note "Properties"
Properties that are only valid for certain EKRecurrenceRules // The properties that follow are only valid for certain recurrence rules, and are always arrays. For recurrence rules // that can be expressed with one of the simple initializers, the arrays will contain a single object, corresponding // to the day of the week, the day of the month, the "NthWeekDay" (for example, the fourth Thursday), or the month of // the year the event recurs. The objects will be NSNumbers, except in the "NthWeekDay" case just mentioned, when // the array will contain a CalNthWeekDay instead of an NSNumber. // // Repeating events using one of the advanced initializers may recur multiple times in the specified time period, for // example, the first and sixteenth days of a month. When this is true, the arrays may contain more than one entry. // // These properties will only be valid for certain EKRecurrenceRules, depending on how the rule's recurrence is // defined. The constraints on when these properties is valid are described below. When these constraints are not met, // the property's value will be nil.
End Class




Links
MBS Xojo Plugins