ios 简便的提醒管理类 可以当闹钟用
来源:互联网 发布:社员网 知乎 编辑:程序博客网 时间:2024/04/25 18:17
github地址: https://github.com/li6185377/LKAlarmManager
方便快捷的把 “您的提醒” 加入到 日历或者本地通知中
会自动处理本地通知超过64个的情况
QQ群号 113767274 有什么问题或者改进的地方大家一起讨论
使用例子 1、 把下面三个 UIApplication回调, 传给LKAlarmManager
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [[LKAlarmMamager shareManager] didFinishLaunchingWithOptions:launchOptions]; return YES;}-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{ [[LKAlarmMamager shareManager] handleOpenURL:url]; return YES;}-(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification{ [[LKAlarmMamager shareManager] didReceiveLocalNotification:notification];}
2、加添提醒到 LKAlarmManager 中.
LKAlarmEvent* event = [LKAlarmEvent new]; event.title = @"参试加入日历事件中"; event.content = @"只有加入到日历当中才有用,是日历中的备注"; ///工作日提醒 event.repeatType = LKAlarmRepeatTypeWork; ///60秒后提醒我 event.startDate = [NSDate dateWithTimeIntervalSinceNow:60]; ///也可以强制加入到本地提醒中 //event.isNeedJoinLocalNotify = YES; ///会先尝试加入日历 如果日历没权限 会加入到本地提醒中 [[LKAlarmMamager shareManager] addAlarmEvent:event callback:^(LKAlarmEvent *alarmEvent) { dispatch_async(dispatch_get_main_queue(), ^{ UILabel* label = ((ViewController*)_window.rootViewController).lb_haha; if(alarmEvent.isJoinedCalendar) { label.text = @"已加入日历"; } else if(alarmEvent.isJoinedLocalNotify) { label.text = @"已加入本地通知"; } else { label.text = @"加入通知失败"; } }); }];
3、 注册 LKAlarmManager 回调,接收到提醒的时候 做你想做的事
///regist delegate [[LKAlarmMamager shareManager] registDelegateWithObject:self];-(void)lk_receiveAlarmEvent:(LKAlarmEvent *)event{ UIAlertView* alertView = [[UIAlertView alloc]initWithTitle:@"接受到通知!" message:event.title delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil]; [alertView show];}
1 0
- ios 简便的提醒管理类 可以当闹钟用
- iOS本地闹钟提醒实现
- [ios] UILocalNotification实现本地的闹钟提醒【转】
- iOS本地推送通知UILocalNotification(可以用做类似闹钟提醒)
- 闹钟提醒
- MyWakeUpTunes:声色俱佳的闹钟提醒应用
- UILocalNotification实现本地的闹钟提醒
- AlarmManager的使用-----闹钟/定时提醒功能
- 修改通话期间闹钟的提醒方式
- 可以简便 代码的 宏
- iOS 添加闹钟和取消提醒(本地通知)
- 闹钟 本地提醒
- 闹钟定时提醒
- android 闹钟提醒
- UILocalNotification实现本地的闹钟提醒的方法
- UILocalNotification实现本地的闹钟提醒的方法。
- UILocalNotification实现本地的闹钟提醒的方法
- UILocalNotification实现本地的闹钟提醒的方法
- Oracle 用Execute执行带有参数的字符串语句。
- 通配符的匹配很全面, 但无法找到元素 'jdbc:embedded-database' 的声明
- unity3d学习之数组习题
- 在网上找到的一个附件上传功能,自己完善了一下,记录防止忘记
- iOS sqlite3 具体代码粘贴
- ios 简便的提醒管理类 可以当闹钟用
- 市场上到底有多少款手机?(1)
- 23种设计模式(超级简洁)
- 2014年11月份工作日志 模板样例
- 表单验证
- github 常用配置和命令
- myeclipse10注册码
- 成为Java高手的25个学习要点
- 理解iso光盘系统