123456789101112131415161718192021222324252627282930313233343536373839404142 |
- //
- // ZYBaseWindow.m
- // VQU
- //
- // Created by Elaine on 2021/1/9.
- // Copyright © 2021 leo. All rights reserved.
- //
- #import "ZYBaseWindow.h"
- @interface ZYBaseWindow ()
- @end
- @implementation ZYBaseWindow
- - (void)viewDidLoad {
- [super viewDidLoad];
-
- [self.view setBackgroundColor:[UIColor clearColor]];
-
- UIView *baseView = [[UIView alloc] initWithFrame:CGRectMake(0, 0,_vWidth, _vHeight)];
- baseView.center = self.view.center;
- baseView.backgroundColor = [UIColor whiteColor];
- [self.view addSubview:baseView];
-
- CAShapeLayer *maskLayer = [CAShapeLayer layer];
- UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:baseView.bounds cornerRadius:10.0f];
- maskLayer.path = path.CGPath;
- baseView.layer.mask = maskLayer;
- self.baseView = baseView;
- }
- - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
- UITouch *touch = [touches.allObjects lastObject];
- if (touch.view == self.view && self.isTouchDismiss) {
- [self dismissViewControllerAnimated:YES completion:nil];
- }
- }
- @end
|