//圓角半徑
let cornerRadius:CGFloat = 10.0
//下面為設置圓角操作(通過遮罩實現(xiàn))
let shapeLayer = CAShapeLayer()
view.layer.mask = nil
let bounds = view.bounds
let bezierPath = UIBezierPath(roundedRect: bounds,
byRoundingCorners: [.topLeft,.topRight],
cornerRadii: CGSize(width: cornerRadius,height: cornerRadius))
shapeLayer.path = bezierPath.cgPath
view.layer.mask = shapeLayer
//圓角半徑
let cornerRadius:CGFloat = 10.0
//下面為設置圓角操作(通過遮罩實現(xiàn))
let shapeLayer = CAShapeLayer()
view.layer.mask = nil
let bounds = view.bounds
let bezierPath = UIBezierPath(roundedRect: bounds,
byRoundingCorners: [.bottomLeft,.bottomRight],
cornerRadii: CGSize(width: cornerRadius,height: cornerRadius))
shapeLayer.path = bezierPath.cgPath
view.layer.mask = shapeLayer