Skip to content

Commit 56c60ec

Browse files
committed
1、兼容iOS 18变更maskView属性名称;
1 parent 85191a5 commit 56c60ec

File tree

5 files changed

+59
-59
lines changed

5 files changed

+59
-59
lines changed

ZJBaseUtils/ZJAlertView/ZJAlertView.m

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@interface ZJAlertView () <UITextFieldDelegate>
1818

1919
/// 遮罩视图
20-
@property (nonatomic,strong) UIView *maskView;
20+
@property (nonatomic,strong) UIView *maskInsideView;
2121
/// 背景视图
2222
@property (nonatomic,strong) UIView *alertView;
2323
/// 关闭按钮
@@ -78,7 +78,7 @@ - (instancetype)initWithFrame:(CGRect)frame
7878
super.backgroundColor = [UIColor clearColor];
7979
_cornerRadius = 8;
8080

81-
[self addSubview:self.maskView];
81+
[self addSubview:self.maskInsideView];
8282
}
8383
return self;
8484
}
@@ -101,16 +101,16 @@ - (void)dealloc {
101101
return _lineViewArray;
102102
}
103103

104-
- (UIView *)maskView
104+
- (UIView *)maskInsideView
105105
{
106-
if (!_maskView) {
107-
_maskView = [[UIView alloc] initWithFrame:self.bounds];
108-
_maskView.backgroundColor = [UIColor clearColor];
106+
if (!_maskInsideView) {
107+
_maskInsideView = [[UIView alloc] initWithFrame:self.bounds];
108+
_maskInsideView.backgroundColor = [UIColor clearColor];
109109

110110
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(clickedTapMaskView)];
111-
[_maskView addGestureRecognizer:tap];
111+
[_maskInsideView addGestureRecognizer:tap];
112112
}
113-
return _maskView;
113+
return _maskInsideView;
114114
}
115115

116116
- (UIView *)alertView {
@@ -120,7 +120,7 @@ - (UIView *)alertView {
120120
_alertView.backgroundColor = [UIColor whiteColor];
121121
_alertView.layer.cornerRadius = self.cornerRadius;
122122
_alertView.layer.masksToBounds = YES;
123-
[self.maskView addSubview:_alertView];
123+
[self.maskInsideView addSubview:_alertView];
124124
}
125125
return _alertView;
126126
}
@@ -254,7 +254,7 @@ - (void)setCustomView:(UIView *)customView {
254254
}
255255
_style = ZJAlertViewStyleCustom;
256256
_alertView = customView;
257-
[self.maskView addSubview:_alertView];
257+
[self.maskInsideView addSubview:_alertView];
258258
}
259259

260260
- (void)setTitle:(NSString *)title {
@@ -331,7 +331,7 @@ - (void)setCornerRadius:(CGFloat)cornerRadius
331331

332332
- (void)setMaskAlpha:(CGFloat)maskAlpha {
333333
_maskAlpha = maskAlpha;
334-
self.maskView.backgroundColor = ZJColorFromRgbWithAlpha(0x0, maskAlpha);
334+
self.maskInsideView.backgroundColor = ZJColorFromRgbWithAlpha(0x0, maskAlpha);
335335
}
336336

337337
- (void)setTitleColor:(UIColor *)titleColor {

ZJBaseUtils/ZJCalendar/ZJCalendarView.m

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
@interface ZJCalendarView()<UICollectionViewDelegate,UICollectionViewDataSource>
2020

21-
@property (nonatomic, strong) UIView *maskView;
21+
@property (nonatomic, strong) UIView *maskInsideView;
2222
@property (nonatomic, strong) UIView *contentView;
2323

2424
@property (nonatomic, strong) UILabel *titleLabel;
@@ -77,16 +77,16 @@ - (instancetype)initWithSelectedType:(ZJCalendarSelectedType)type fromStartDate:
7777

7878
#pragma mark -
7979

80-
- (UIView *)maskView {
81-
if (!_maskView) {
82-
_maskView = [[UIView alloc] init];
83-
_maskView.backgroundColor = [ZJColorFromRGB(0x181E28) colorWithAlphaComponent:0.7];
80+
- (UIView *)maskInsideView {
81+
if (!_maskInsideView) {
82+
_maskInsideView = [[UIView alloc] init];
83+
_maskInsideView.backgroundColor = [ZJColorFromRGB(0x181E28) colorWithAlphaComponent:0.7];
8484
weakSelf(self);
85-
[_maskView zj_addSingleTap:^(id _Nonnull obj) {
85+
[_maskInsideView zj_addSingleTap:^(id _Nonnull obj) {
8686
[weakSelf dismiss];
8787
}];
8888
}
89-
return _maskView;
89+
return _maskInsideView;
9090
}
9191

9292
- (UIView *)contentView {
@@ -140,7 +140,7 @@ - (UICollectionView *)collectionView {
140140
}
141141

142142
- (void)configSubViews {
143-
[self addSubview:self.maskView];
143+
[self addSubview:self.maskInsideView];
144144
[self addSubview:self.contentView];
145145

146146
self.okButton = [ZJButton buttonWithStyle:ZJButtonStyleColor];
@@ -168,7 +168,7 @@ - (void)configSubViews {
168168
- (void)layoutSubviews {
169169
[super layoutSubviews];
170170

171-
self.maskView.frame = self.bounds;
171+
self.maskInsideView.frame = self.bounds;
172172
self.titleLabel.frame = CGRectMake(55, 0, self.contentView.bounds.size.width-110, 55);
173173
self.closeButton.frame = CGRectMake(self.contentView.bounds.size.width-16-55, 0, 55, 55);
174174
self.weekTitleView.frame = CGRectMake([self getCollectionViewMargin], 55, ZJScreenWidth()-[self getCollectionViewMargin]*2, 55);

ZJBaseUtils/ZJPickerView/ZJPickerView.m

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ @interface ZJPickerView () <UIPickerViewDataSource, UIPickerViewDelegate>
2020
/// 背景视图
2121
@property (nonatomic,strong) UIView *backView;
2222
/// 遮罩视图
23-
@property (nonatomic,strong) UIView *maskView;
23+
@property (nonatomic,strong) UIView *maskInsideView;
2424

2525
@property (nonatomic,strong) NSMutableArray<UIPickerView *> *pickerViewArray;
2626
@property (nonatomic,assign) CGRect pickerFrame;
@@ -53,7 +53,7 @@ - (instancetype)initWithFrame:(CGRect)frame
5353
self.backgroundColor = [UIColor whiteColor];
5454

5555
[self setPickerFrame:frame];
56-
[self addSubview:self.maskView];
56+
[self addSubview:self.maskInsideView];
5757
[self addSubview:self.backView];
5858
[self.backView addSubview:self.titleLB];
5959
[self.backView addSubview:self.okBtn];
@@ -188,16 +188,16 @@ - (UIView *)topLineView
188188
return _topLineView;
189189
}
190190

191-
- (UIView *)maskView
191+
- (UIView *)maskInsideView
192192
{
193-
if (!_maskView) {
194-
_maskView = [[UIView alloc] initWithFrame:self.bounds];
195-
_maskView.backgroundColor = [UIColor clearColor];
193+
if (!_maskInsideView) {
194+
_maskInsideView = [[UIView alloc] initWithFrame:self.bounds];
195+
_maskInsideView.backgroundColor = [UIColor clearColor];
196196

197197
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(clickedCancelAction)];
198-
[_maskView addGestureRecognizer:tap];
198+
[_maskInsideView addGestureRecognizer:tap];
199199
}
200-
return _maskView;
200+
return _maskInsideView;
201201
}
202202

203203
- (void)setPickerFrame:(CGRect)pickerFrame
@@ -460,7 +460,7 @@ - (void)show
460460
[UIView animateWithDuration:0.3 animations:^{
461461
@strongify(self);
462462
self.hidden = NO;
463-
self.maskView.backgroundColor = self.maskColor;
463+
self.maskInsideView.backgroundColor = self.maskColor;
464464
self.backView.zj_top = self.zj_height - self.pickerFrame.size.height;
465465
} completion:^(BOOL finished) {
466466
}];
@@ -471,7 +471,7 @@ - (void)dismiss
471471
@weakify(self);
472472
[UIView animateWithDuration:0.3 animations:^{
473473
@strongify(self);
474-
self.maskView.backgroundColor = [UIColor clearColor];
474+
self.maskInsideView.backgroundColor = [UIColor clearColor];
475475
self.backView.zj_top = self.zj_height;
476476
} completion:^(BOOL finished) {
477477
@strongify(self);

ZJBaseUtils/ZJRatingView/ZJRatingView.m

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ @interface ZJRatingView ()
2424
/// 背景星星颜色(画布模式)
2525
@property (nonatomic,strong) CAShapeLayer *backColorLayer;
2626
///画布模式:遮罩层,图片模式:底视图
27-
@property (nonatomic,strong) ZJRatingStarView *maskView;
27+
@property (nonatomic,strong) ZJRatingStarView *maskInsideView;
2828
/// 前置视图(图片模式)
2929
@property (nonatomic,strong) ZJRatingStarView *frontStarView;
3030
/// 不是点击触发的布局
@@ -57,7 +57,7 @@ - (void)setFrontImage:(UIImage *)frontImage
5757
_isImageMode = YES;
5858
} else {
5959
_isImageMode = NO;
60-
[self.maskView removeFromSuperview];
60+
[self.maskInsideView removeFromSuperview];
6161
if (_frontStarView) {
6262
[self.frontStarView removeFromSuperview];
6363
_frontStarView = nil;
@@ -68,8 +68,8 @@ - (void)setFrontImage:(UIImage *)frontImage
6868
- (void)setDefaultImage:(UIImage *)defaultImage
6969
{
7070
_defaultImage = defaultImage;
71-
if (_maskView) {
72-
self.maskView.defaultImage = defaultImage;
71+
if (_maskInsideView) {
72+
self.maskInsideView.defaultImage = defaultImage;
7373
}
7474
}
7575

@@ -95,8 +95,8 @@ - (void)layoutSubviews
9595
- (void)updateLayers
9696
{
9797
if (!self.isTouchLayout) {
98-
self.maskView.frame = self.bounds;
99-
[self.maskView updateViewConstrains];
98+
self.maskInsideView.frame = self.bounds;
99+
[self.maskInsideView updateViewConstrains];
100100
}
101101

102102
if (self.isImageMode) {
@@ -114,29 +114,29 @@ - (void)updateLayers
114114
[path addLineToPoint:CGPointMake(self.frame.size.width, self.frame.size.height/2)];
115115
self.backColorLayer.path = path.CGPath;
116116
self.backColorLayer.lineWidth = self.frame.size.height;
117-
self.backColorLayer.mask = self.maskView.layer;
117+
self.backColorLayer.mask = self.maskInsideView.layer;
118118
self.backColorLayer.strokeEnd = self.firstScore / 10.0;
119119
}
120120
self.isTouchLayout = NO;
121121
}
122122

123-
- (ZJRatingStarView *)maskView
123+
- (ZJRatingStarView *)maskInsideView
124124
{
125-
if (!_maskView) {
126-
_maskView = [[ZJRatingStarView alloc] initWithStarCount:self.starCount andSpace:self.starSpace];
127-
_maskView.defaultImage = self.defaultImage;
125+
if (!_maskInsideView) {
126+
_maskInsideView = [[ZJRatingStarView alloc] initWithStarCount:self.starCount andSpace:self.starSpace];
127+
_maskInsideView.defaultImage = self.defaultImage;
128128
}
129129

130-
return _maskView;
130+
return _maskInsideView;
131131
}
132132

133133
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
134134
{
135135
UITouch * touch = [touches anyObject];
136136
CGPoint touchPoint = [touch locationInView:self];
137-
CGPoint newPoint = [self convertPoint:touchPoint toView:self.maskView];
137+
CGPoint newPoint = [self convertPoint:touchPoint toView:self.maskInsideView];
138138

139-
[self.maskView transformPointWithTouchPoint:newPoint completion:^(CGPoint transformPoint, CGFloat score) {
139+
[self.maskInsideView transformPointWithTouchPoint:newPoint completion:^(CGPoint transformPoint, CGFloat score) {
140140
[self strokeWithTransformPoint:transformPoint score:score];
141141
}];
142142
}
@@ -145,16 +145,16 @@ - (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
145145
{
146146
UITouch * touch = [touches anyObject];
147147
CGPoint touchPoint = [touch locationInView:self];
148-
CGPoint newPoint = [self convertPoint:touchPoint toView:self.maskView];
148+
CGPoint newPoint = [self convertPoint:touchPoint toView:self.maskInsideView];
149149

150-
[self.maskView transformPointWithTouchPoint:newPoint completion:^(CGPoint transformPoint, CGFloat score) {
150+
[self.maskInsideView transformPointWithTouchPoint:newPoint completion:^(CGPoint transformPoint, CGFloat score) {
151151
[self strokeWithTransformPoint:transformPoint score:score];
152152
}];
153153
}
154154

155155
- (void)strokeWithTransformPoint:(CGPoint)point score:(CGFloat)score
156156
{
157-
CGPoint newPoint = [self convertPoint:point fromView:self.maskView];
157+
CGPoint newPoint = [self convertPoint:point fromView:self.maskInsideView];
158158
if (self.isImageMode) {
159159
self.isTouchLayout = YES;
160160
if (newPoint.x < 0) newPoint.x = 0;
@@ -194,7 +194,7 @@ - (ZJRatingStarView *)frontStarView
194194
_frontStarView.backgroundColor = [UIColor clearColor];
195195
_frontStarView.defaultImage = self.frontImage;
196196

197-
[self addSubview:self.maskView];
197+
[self addSubview:self.maskInsideView];
198198
[self addSubview:self.frontStarView];
199199
}
200200

ZJBaseUtils/ZJSheetView/ZJSheetView.m

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@interface ZJSheetView ()
1818

1919
/// 遮罩视图
20-
@property (nonatomic,strong) UIView *maskView;
20+
@property (nonatomic,strong) UIView *maskInsideView;
2121
/// 背景视图
2222
@property (nonatomic,strong) UIView *bgView;
2323
/// 选择框视图
@@ -51,7 +51,7 @@ - (instancetype)initWithFrame:(CGRect)frame {
5151
_cornerRadius = 8;
5252
_maskAlpha = 0.7;
5353

54-
[self addSubview:self.maskView];
54+
[self addSubview:self.maskInsideView];
5555
}
5656
return self;
5757
}
@@ -70,22 +70,22 @@ - (instancetype)initWithFrame:(CGRect)frame {
7070
return _lineViewArray;
7171
}
7272

73-
- (UIView *)maskView
73+
- (UIView *)maskInsideView
7474
{
75-
if (!_maskView) {
76-
_maskView = [[UIView alloc] initWithFrame:self.bounds];
77-
_maskView.backgroundColor = ZJColorFromRgbWithAlpha(0x0, self.maskAlpha);
75+
if (!_maskInsideView) {
76+
_maskInsideView = [[UIView alloc] initWithFrame:self.bounds];
77+
_maskInsideView.backgroundColor = ZJColorFromRgbWithAlpha(0x0, self.maskAlpha);
7878
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(clickedTapMaskView)];
79-
[_maskView addGestureRecognizer:tap];
79+
[_maskInsideView addGestureRecognizer:tap];
8080
}
81-
return _maskView;
81+
return _maskInsideView;
8282
}
8383

8484
- (UIView *)bgView {
8585
if (!_bgView) {
8686
_bgView = [[UIView alloc] initWithFrame:CGRectMake(0, ZJScreenHeight(), ZJScreenWidth(), 0)];
8787
_bgView.backgroundColor = [UIColor clearColor];
88-
[self.maskView addSubview:_bgView];
88+
[self.maskInsideView addSubview:_bgView];
8989
}
9090
return _bgView;
9191
}
@@ -187,7 +187,7 @@ - (void)setCornerRadius:(CGFloat)cornerRadius
187187

188188
- (void)setMaskAlpha:(CGFloat)maskAlpha {
189189
_maskAlpha = maskAlpha;
190-
self.maskView.backgroundColor = ZJColorFromRgbWithAlpha(0x0, maskAlpha);
190+
self.maskInsideView.backgroundColor = ZJColorFromRgbWithAlpha(0x0, maskAlpha);
191191
}
192192

193193
- (void)setTitle:(NSString *)title {
@@ -218,7 +218,7 @@ - (void)setTopCustomView:(UIView *)topCustomView {
218218
[_topCustomView removeFromSuperview];
219219
}
220220
_topCustomView = topCustomView;
221-
[self.maskView addSubview:topCustomView];
221+
[self.maskInsideView addSubview:topCustomView];
222222
}
223223

224224

0 commit comments

Comments
 (0)