镂空效果
let bpath = UIBezierPath.init(rect: self.bounds)
bpath.append(UIBezierPath.init(roundedRect: CGRect.init(x: 1, y: 16, width: self.width - 2, height: self.height - 32), cornerRadius: 8).reversing())
let layer = CAShapeLayer.init()
layer.path = bpath.cgPath
self.layer.mask = layer
网友评论