iOS防止用户截屏
来源:互联网 发布:java集合泛型转换工具 编辑:程序博客网 时间:2024/06/03 04:15
NSOperationQueue *mainQueue = [NSOperationQueuemainQueue]; [[NSNotificationCenterdefaultCenter]addObserverForName:UIApplicationUserDidTakeScreenshotNotification object:nilqueue:mainQueueusingBlock:^(NSNotification *note){ [selfjiePing]; }];-(void)jiePing{ UIAlertView *alertView=[[UIAlertViewalloc]initWithTitle:nilmessage:@"[安全提醒]内含付款码,只适合当面使用。不要截图或分享给他人以保障资金安全。"delegate:selfcancelButtonTitle:@"绝不给别人"otherButtonTitles:@"仅我自己用",nil]; alertView.tag=105; [alertView show]; }//这种写法会导致整个程序任何一个界面截图都会有弹出提示框,因为根本就没有指定哪个控制器,而且是一直在主线程里面NSOperationQueue *mainQueue = [NSOperationQueuemainQueue]; [[NSNotificationCenter defaultCenter]addObserver:selfselector:@selector(jiePing)name:UIApplicationUserDidTakeScreenshotNotification object:nil]; //这个写法是针对于当前控制器离开当前控制器的时候 最好移除通知 [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector( jiePing) object:nil]; [[NSNotificationCenter defaultCenter] removeObserver:selfname:UIApplicationUserDidTakeScreenshotNotification object:nil];
原文链接:http://blog.csdn.net/ios_xumin/article/details/51788544
阅读全文
0 0
- iOS防止用户截屏
- iOS防止用户截屏
- iOS 防止用户不停的点击按钮
- iOS防止用户恶意点击场景分析、防止用户恶意点击方法之本地动态验证码生成
- iOS开发之禁止用户切换键盘(防止用户切换其它键盘)
- iOS开发之禁止用户切换键盘(防止用户切换其它键盘)
- 防止用户重复登陆
- 防止用户重复登录
- 防止用户重复登录
- 防止用户重复登录
- 防止用户重复登录
- andriod 防止截屏
- Android防止截屏
- 如何防止 iOS 锁屏
- ios 异常 防止崩溃
- 防止用户重复登陆系统
- 防止用户重复登陆系统
- 防止用户重复登陆系统
- LinuxKernelDevelopment_读书笔记
- grep正则表达式(二)
- 无法访问虚拟机no route to host 解决 .
- c++4
- 《Core Java》读书笔记——第4章
- iOS防止用户截屏
- duilib 内存画图
- Servlet线程安全解析
- 内存栅栏:软件高手的硬件观(四)
- BZOJ 3669: [Noi2014]魔法森林 LCT
- 1808 Alipay System 1 user(Eden)
- Unity给游戏添加倒计时和分数
- Python 爬虫安装beautufulsoup4
- tomcat的目录结构