Skip to content

Commit

Permalink
基础YD库导入完成
Browse files Browse the repository at this point in the history
  • Loading branch information
chong2vv committed Oct 14, 2022
1 parent d91d6ce commit b607bb5
Show file tree
Hide file tree
Showing 111 changed files with 12,537 additions and 92 deletions.
24 changes: 24 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,35 @@ abstract_target 'Demo' do

end

target 'YDSafeThread' do

end

target 'YDEmptyView' do

end

target 'YDBlockKit' do

end

target 'YDAuthorizationUtil' do

end

target 'YDJPush' do
pod 'JPush' , '~> 3.2.4'
end

target 'YDImageService' do
pod 'YYWebImage', '~> 1.0.5'
pod 'YYImage', '~> 1.0.4'
pod 'YDFoundation/YDSafeThread', :path => '.'
end

target 'YDNetwrokManager' do
pod 'YTKNetwork', '~> 3.0.6'
end

end

Expand Down
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@-->
60 changes: 60 additions & 0 deletions YDAuthorizationUtil/YDAuthorizationUtil.h
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
Loading

0 comments on commit b607bb5

Please sign in to comment.