iOS 监听用户是否手动修改了设备时间
2016-01-12 14:28
543 查看
可以通过注册系统通知:UIApplicationSignificantTimeChangeNotification 去实现
通过这个,我们可以获取用户改了时区、时间、24/12小时制的通知,但是信息内容有限,apple的解释是:“Posted when there is a significant change in time, for example, change to a new day
(midnight), carrier time update, and change to or from daylight savings time.
This notification does not contain a
即获取到的通知内容不携带userInfo 字典。
- (void)observeUserDeviceTimeIsChanged { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deviceTimeIsChanged) name:UIApplicationSignificantTimeChangeNotification object:nil]; } - (void)deviceTimeIsChanged { NSLogI(@"用户手动调整了设备时间"); }
通过这个,我们可以获取用户改了时区、时间、24/12小时制的通知,但是信息内容有限,apple的解释是:“Posted when there is a significant change in time, for example, change to a new day
(midnight), carrier time update, and change to or from daylight savings time.
This notification does not contain a
userInfodictionary.”
即获取到的通知内容不携带userInfo 字典。
相关文章推荐
- iOS开发-动画总结
- iOS 9的 Universal Links 通用链接使用介绍
- iOS屏幕尺寸
- ios 本地提醒
- IOS 用keychain(钥匙串)保存用户名和密码
- iOS--加载cell
- Not a PNG file iOS 真机上报错 模拟器上能顺利运行
- iOS 正则表达式-判断邮箱、手机号
- iOS入门学习(页面间传值)
- iOS日期计算整理
- iOS 单例
- 如何优雅地进行页面间的跳转(iOS)
- iOS8中如何将状态栏的字体颜色改为白色
- IOS流媒体播放
- ios中摄像头/相册获取图片,压缩图片,上传服务器方法总结
- iOS应用程序生命周期(前后台切换,应用的各种状态)详解
- 基于IOS下的支付宝SDK的学习与使用——实现产品支付(二)
- iOS多线程gcd
- iOS图像处理片段
- iOS View的旋转