一款好用的iOS权限请求与检测工具。iOS system privacy permission check tools.
TKPermissionKit是一款好用的iOS权限请求与检测工具!
1.全部导入:
pod 'TKPermissionKit'
2.按需导入,推荐此方式:
pod 'TKPermissionKit/Photo' #相册
pod 'TKPermissionKit/Camera ' #相机
pod 'TKPermissionKit/Media' #媒体资料库
pod 'TKPermissionKit/Bluetooth' #蓝牙
pod 'TKPermissionKit/Microphone' #麦克风
pod 'TKPermissionKit/Speech' #语音识别
pod 'TKPermissionKit/LocationWhen' #定位-应用使用期间
pod 'TKPermissionKit/LocationAlways' #定位-始终
pod 'TKPermissionKit/Notification' #通知
pod 'TKPermissionKit/Contacts' #通讯录
pod 'TKPermissionKit/Calendar' #日历
pod 'TKPermissionKit/Reminder' #提醒事项
pod 'TKPermissionKit/NetWork' #网路--
pod 'TKPermissionKit/Motion' #运动于健身
pod 'TKPermissionKit/Home' #homeKit
pod 'TKPermissionKit/Health' #健康
pod 'TKPermissionKit/FileAndFolders' #文件与文件夹
pod 'TKPermissionKit/Tracking' #AppTrackingTransparency
pod 'TKPermissionKit/Siri' #Siri
1.直接调用类方法如:
[TKPermissionPhoto authWithAlert:YES completion:^(BOOL isAuth) {
if (isAuth) {
NSLog(@"相册权限获取成功!");
}else{
NSLog(@"相册权限获取失败");
}
}];
2.注意
completion:^(BOOL isAuth) {
//这个回调都被切换到了主线程
}
本框架中的网络检测模块基本上没有作用,可以使用ZYNetworkAccessibility
使用具体模块时,可以查看对应模块头文件中的使用说明与注意事项!