RRULE-to-EKRecurrenceRule is the easiest way to transform a RRULE string representation (RFC 2445) into an EKRecurrenceRule. 'EKRecurrenceRule+RRULE' is an Objective-C category which adds a new initializer to the EKRecurrenceRule class. EKRecurrenceRule is available in iOS 4.0 and later and needs the EventKit framework.
- Download RRULE-to-EKRecurrenceRule and play with the included Xcode project.
- Copy 'EKRecurrenceRule+RRULE.h' and 'EKRecurrenceRule+RRULE.m' into your own Xcode project.
- Add
#import "EKRecurrenceRule+RRULE.h"
to all files you would like to use RRULE-to-EKRecurrenceRule.
#import "EKRecurrenceRule+RRULE.h"
- (void)testMethod
{
// Test
NSString *rfc2445String = @"FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-2"; // The 2nd to last weekday of the month
// Result
EKRecurrenceRule *recurrenceRule = [[EKRecurrenceRule alloc] initWithString:rfc2445String];
NSLog(@"%@", recurrenceRule);
}
- EKRecurrenceRule does add WKST=SU automatically
- EKRecurrenceRule does only support DAILY, WEEKLY, MONTHLY, YEARLY frequencies
RRULE-to-EKRecurrenceRule uses ARC.
If you are including the RRULE-to-EKRecurrenceRule sources directly into a project that does not yet use Automatic Reference Counting, you will need to set the -fobjc-arc
compiler flag on all of the RRULE-to-EKRecurrenceRule source files. To do this in Xcode, go to your active target and select the "Build Phases" tab. Now select all RRULE-to-EKRecurrenceRule source files, press Enter, insert -fobjc-arc
and then "Done" to enable ARC for RRULE-to-EKRecurrenceRule.
RRULE-to-EKRecurrenceRule is licensed under the terms of the Apache License, version 2.0. Please see the LICENSE file for full details.
RRULE-to-EKRecurrenceRule is brought to you by Jochen Schöllig and the Codeatelier team.