kEvin
kEvin

Reputation: 411

iphone how can i add the events in the calendar?

I am trying to make a calendar and view the calendar in which i can create ,edit or delete the events on tap of the button , the events created should be viewed weekly I have tried out kal ,tapku library Calendar but could not find appropriate.Are there any link or code that could help me out with this

Upvotes: 3

Views: 1768

Answers (1)

Kuldeep
Kuldeep

Reputation: 2589

#import <EventKit/EventKit.h>
#import <EventKitUI/EventKitUI.h>

EKEventViewController *detailViewController;
EKEventStore *eventStore;
eventStore = [[EKEventStore alloc] init]; 
EKEvent *event = [EKEvent eventWithEventStore:eventStore]; 
event.title = @"Test Event"; 
event.startDate = copyofnextappdt; 
event.endDate = copyofnextappdt;
[event setCalendar:[eventStore defaultCalendarForNewEvents]];
NSError *err;
[eventStore saveEvent:event span:EKSpanThisEvent error:&err];

Upvotes: 3

Related Questions