扫码关注官方订阅号
我看在mail和webView里有日期显示,就可以点击然后出来一个actionsheet,让用户选择创建一个日历事件。 那在程序里有没有这种接口?有没有可能,我通过程序去创建一个日历事件?系统那个ActionSheet,不是我说啊,太难看了。。。
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...
Check EKEvent out
EKEventStore *eventDB = [[EKEventStore alloc] init]; EKEvent *myEvent = [EKEvent eventWithEventStore:eventDB]; myEvent.title = @"New Event"; myEvent.startDate = [[NSDate alloc]init ]; myEvent.endDate = [[NSDate alloc]init ]; myEvent.allDay = YES; [myEvent setCalendar:[eventDB defaultCalendarForNewEvents]]; NSError *err; [eventDB saveEvent:myEvent span:EKSpanThisEvent error:&err]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Event Created" message:@"Yay!?" delegate:nil cancelButtonTitle:@"Okay" otherButtonTitles:nil]; [alert show];
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
扫描下载App
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
Check EKEvent out