效果图 2019-09-10 下午5.00.53.png
class CustomerView: UIView {
// var maskView = UIView.init()
override init(frame: CGRect) {
super.init(frame: frame)
self.backgroundColor = UIColor.black.withAlphaComponent(0.6)
let fullPath = UIBezierPath.init(rect: UIScreen.main.bounds)
let layer = CAShapeLayer.init()
let bpath = UIBezierPath.init(roundedRect: CGRect(x: 100, y: 100, width: 100, height: 100), cornerRadius: 5).reversing()
let bpath1 = UIBezierPath.init(roundedRect: CGRect(x: 100, y: 200, width: 100, height: 100), cornerRadius: 50).reversing()
let arcPath = UIBezierPath.init(arcCenter: CGPoint(x: 150, y: 320), radius: 50, startAngle: 0, endAngle: CGFloat(M_PI*3/4), clockwise: true).reversing()
fullPath.append(bpath)
fullPath.append(bpath1)
fullPath.append(arcPath)
layer.path = fullPath.cgPath
self.layer.mask = layer
}
网友评论