-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
111 changed files
with
12,537 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
YDAuthorizationUtil/YDAuthorizationUtil.docc/YDAuthorizationUtil.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# ``YDAuthorizationUtil`` | ||
|
||
<!--@START_MENU_TOKEN@-->Summary<!--@END_MENU_TOKEN@--> | ||
|
||
## Overview | ||
|
||
<!--@START_MENU_TOKEN@-->Text<!--@END_MENU_TOKEN@--> | ||
|
||
## Topics | ||
|
||
### <!--@START_MENU_TOKEN@-->Group<!--@END_MENU_TOKEN@--> | ||
|
||
- <!--@START_MENU_TOKEN@-->``Symbol``<!--@END_MENU_TOKEN@--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// | ||
// YDCameraPermissionUtil.h | ||
// yd-general-ios-app | ||
// | ||
// Created by 王远东 on 2021/10/1. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
typedef NS_ENUM(NSUInteger, EYDAuthorization) { | ||
EYDAuthorizationPhoto, | ||
EYDAuthorizationCamera, | ||
EYDAuthorizationMicrophone | ||
}; | ||
|
||
typedef NS_ENUM(NSUInteger, EYDAuthorizationStatus) { | ||
EYDAuthorizationStatusNotDetermined,//尚未决定 | ||
EYDAuthorizationStatusRestricted,//限制 | ||
EYDAuthorizationStatusDenied,//拒绝 | ||
EYDAuthorizationStatusAuthorized,//已授权 定位时:使用AuthorizedAlways 或 AuthorizedWhenInUse | ||
EYDAuthorizationStatusAuthorizedAlways,//定位使用 总是授权 | ||
EYDAuthorizationStatusAuthorizedWhenInUse,//定位使用 使用时授权 | ||
}; | ||
|
||
@interface YDAuthorizationUtil : NSObject | ||
|
||
|
||
+ (EYDAuthorizationStatus)authorizedStatusWithType:(EYDAuthorization)authorizationType; | ||
|
||
+ (BOOL)authorizedWithType:(EYDAuthorization)authorizationType; | ||
|
||
+ (void)authorizeWithType:(EYDAuthorization)type completion:(void(^)(BOOL authorized))completion; | ||
|
||
////拍照并存储相册 需要请求相机、相册两个权限 | ||
+ (void)authorizedForTakePhotoAndSaveWithCompletion:(void(^)(BOOL authorized))completion; | ||
|
||
//录制视频 需要相机、相册、麦克风三个权限 其中只要有一个权限无法获取,都会导致录制出错 | ||
+ (void)authorizedForRecordVideoWithCompletion:(void(^)(BOOL authorized))completion; | ||
|
||
//语音 | ||
+ (void)authorizedForRecordWithCompletion:(void(^)(BOOL authorized))completion; | ||
|
||
//相册 | ||
+ (void)authorizedForPhotoWithCompletion:(void(^)(BOOL authorized))completion; | ||
|
||
//相机 | ||
+ (void)authorizedForCameraWithCompletion:(void(^)(BOOL authorized))completion; | ||
|
||
//相机,是否弹窗 | ||
+ (void)authorizedForCameraWithCompletion:(void(^)(BOOL authorized))completion needAlert:(BOOL)needAlert; | ||
|
||
//去授权 | ||
+ (void)gotoSetting; | ||
|
||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
Oops, something went wrong.