Commit 0fb14af2 cgx

修复弹框点击不消失bug

1 个父辈 037feb51
......@@ -282,6 +282,8 @@
D0CFD3CC27FB3B910002982B /* launcher@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "launcher@2x.png"; sourceTree = "<group>"; };
D0CFD3CD27FB3B910002982B /* launcher@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "launcher@3x.png"; sourceTree = "<group>"; };
D0CFD3CE27FB3B920002982B /* launcher.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = launcher.png; sourceTree = "<group>"; };
D0D7480328118D0B00036379 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = "<group>"; };
D0D7480428118D0B00036379 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/LaunchScreen.strings"; sourceTree = "<group>"; };
D0E65FF42807A654006562F2 /* NSArray+HYBUnicodeReadable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+HYBUnicodeReadable.m"; sourceTree = "<group>"; };
D0E65FF52807A654006562F2 /* NSDictionary+HYBUnicodeReadable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+HYBUnicodeReadable.m"; sourceTree = "<group>"; };
D0E65FF62807A654006562F2 /* NSSet+HYBUnicodeReadable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSSet+HYBUnicodeReadable.m"; sourceTree = "<group>"; };
......@@ -888,6 +890,7 @@
knownRegions = (
en,
Base,
"zh-Hans",
);
mainGroup = D0B5EC9827F2D9DE003EDFE3;
productRefGroup = D0B5ECA227F2D9DE003EDFE3 /* Products */;
......@@ -1058,6 +1061,7 @@
isa = PBXVariantGroup;
children = (
D0B5ECAE27F2D9DE003EDFE3 /* Base */,
D0D7480328118D0B00036379 /* zh-Hans */,
);
name = Main.storyboard;
sourceTree = "<group>";
......@@ -1066,6 +1070,7 @@
isa = PBXVariantGroup;
children = (
D0B5ECB327F2D9E0003EDFE3 /* Base */,
D0D7480428118D0B00036379 /* zh-Hans */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
......@@ -1078,6 +1083,7 @@
baseConfigurationReference = D0B5ECC027F2E217003EDFE3 /* Debug.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
......@@ -1138,6 +1144,7 @@
baseConfigurationReference = D0B5ECC427F2E27B003EDFE3 /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
......@@ -1315,6 +1322,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
......
/* Class = "UITabBarItem"; title = "我的"; ObjectID = "GRP-mg-DTk"; */
"GRP-mg-DTk.title" = "我的";
/* Class = "UITabBarItem"; title = "首页"; ObjectID = "Smw-jw-8ah"; */
"Smw-jw-8ah.title" = "首页";
/* Class = "UITabBarItem"; title = "AI睡眠教练"; ObjectID = "hhA-gt-gs3"; */
"hhA-gt-gs3.title" = "AI睡眠教练";
......@@ -23,6 +23,9 @@
self.dk_backgroundColorPicker = DKColorPickerWithColors(ColorFromHex(0x6F7587), DSClearColor, DSWhite);
self.backgroundColor = [self.backgroundColor colorWithAlphaComponent:0.6];
UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
[self addGestureRecognizer:tapGR];
[self addSubview:self.alertView];
[self.alertView mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.equalTo(self);
......@@ -53,6 +56,12 @@
[self dismissCloseUserAlertView];
}
- (void)tapAction:(UITapGestureRecognizer *)gesture {
if (!CGRectContainsPoint(self.alertView.frame, [gesture locationInView:self])) {
[self dismissCloseUserAlertView];
}
}
#pragma mark - lazy
- (UIView *)alertView {
if (!_alertView) {
......
......@@ -12,6 +12,7 @@
@interface PhotoAlertView () <JWMImagePickerDelegate, RSKImageCropViewControllerDelegate>
@property (nonatomic, strong) UIView *photoView;
@property (nonatomic, strong) JWMImagePickerController *imgePicker;
@end
@implementation PhotoAlertView {
......@@ -25,6 +26,9 @@
self.backgroundColor = AlertDarkColor;
self.backgroundColor = [self.backgroundColor colorWithAlphaComponent:0.6];
UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
[self addGestureRecognizer:tapGR];
[self addSubview:self.photoView];
[self.photoView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self);
......@@ -78,11 +82,11 @@
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
AVAuthorizationStatus authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
if(authStatus == AVAuthorizationStatusRestricted || authStatus == AVAuthorizationStatusDenied) {
[[[UIAlertView alloc] initWithTitle:@"" message:@"请前往iPhone的“设置-隐私-相机”,允许APP访问您的相机。" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil] show];
[DSProgressHUD showDetailInfo:@"请前往iPhone的“设置-隐私-相机”,允许APP访问您的相机。" ];
return;
}
} else {
[[[UIAlertView alloc] initWithTitle:@"" message:@"您的设备无摄像头!" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil] show];
[DSProgressHUD showDetailInfo:@"您的设备无摄像头!" ];
return;
}
[self presentViewController:ImagePickerStyleCamera];
......@@ -92,10 +96,16 @@
}
- (void)presentViewController:(ImagePickerStyle)style {
_tmpVc.navigationController.navigationBar.hidden = YES;
JWMImagePickerController *picker = [[JWMImagePickerController alloc] initWithImagePickerStyle:style];
picker.JWMdelegate = self;
[_tmpVc presentViewController:picker animated:YES completion:nil];
// _tmpVc.navigationController.navigationBarHidden = YES;
self.imgePicker = [[JWMImagePickerController alloc] initWithImagePickerStyle:style];
self.imgePicker.JWMdelegate = self;
[_tmpVc presentViewController:self.imgePicker animated:YES completion:nil];
}
- (void)tapAction:(UITapGestureRecognizer *)gesture {
if (!CGRectContainsPoint(self.photoView.frame, [gesture locationInView:self])) {
[self dismissPhotoAlertView];
}
}
#pragma mark - JWMImagePickerDelegate
......
......@@ -40,9 +40,13 @@
UIAlertAction *action3 = [UIAlertAction actionWithTitle:@"QQ好友" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[self shareTextToPlatformType:UMSocialPlatformType_QQ];
}];
UIAlertAction *action4 = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
[self dismissViewControllerAnimated:YES completion:nil];
}];
[alertVC addAction:action1];
[alertVC addAction:action2];
[alertVC addAction:action3];
[alertVC addAction:action4];
[self presentViewController:alertVC animated:YES completion:nil];
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!