本项目为 iOS 系统权限请求相关的方法集合框架,包括各类隐私权限。
Info.plist 中需要添加记录:Privacy - Photo Library Usage Description
import Authorman
import Photos
Authorman.request { (status) in
if status == .authorized {
// ...
}
}
Info.plist 中需要添加记录:Privacy - Calendars Usage Description
Authorman.request(type: .event) { (success, error) in
if success {
// ...
} else {
// ...
}
}
Info.plist 中需要添加记录:Privacy - Reminders Usage Description
Authorman.request(type: .reminder) { (success, error) in
if success {
// ...
} else {
// ...
}
}
- 新增授权协议 XXXAuthorization
- 在协议内定义两个方法:
request
checkAuthorizationStatusForXXX
- 添加 Authorman 扩展文件,实现协议 XXXAuthorization 对应的方法