Open .ics file in iOS App

烈酒焚心 提交于 2019-11-30 16:11:15

I just used the following code:

- (IBAction)displayICS:(id)sender
{
    NSString *path = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"ics"];
    NSURL *url = [NSURL fileURLWithPath:path];
    UIDocumentInteractionController *dc = [UIDocumentInteractionController interactionControllerWithURL:url];
    dc.delegate = self;
    [dc presentPreviewAnimated:YES];
}
-(UIViewController *)documentInteractionControllerViewControllerForPreview:(UIDocumentInteractionController *)controller
{
    return self;
}
ahalls

I have found there are two projects that enable you to open an ICS file and get events, dates and other information out of it as Objective-C objects.

MXLCalendarManager seems to be a bit further along and will allow you to pull out the events from the ICS file search on date and add the events to the users iOS calendar. This might be what your looking for. GitHub Project MXLCalendarManager It also supports writing new ICS files.

I've created a project that uses the libical library written in C to parse the complete ICS file. The project is still in the early stages and could use some more tender care before its ready to just drop into a project. You can check it out at Github Project XbICalendar More details on libical can be found at GitHub Project libical

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!