iOS用贝塞尔曲线设置任意圆角

let path = UIBezierPath.init(roundedRect: CGRect(x: 0, y: 0, width: 303, height: 118), byRoundingCorners: UIRectCorner(rawValue: UIRectCorner.topLeft.rawValue | UIRectCorner.topRight.rawValue), cornerRadii: CGSize(width: 6, height: 6))
let lay = CAShapeLayer.init()
lay.path = path.cgPath
self.carStoreBG.layer.mask  = lay

你可能感兴趣的:(iOS用贝塞尔曲线设置任意圆角)