swift 切指定的圆角UIRectCorner

let maskPath = UIBezierPath(roundedRect: bounds, 
byRoundingCorners: [.topLeft, .topRight], cornerRadii:CGSize(width:10, height:10))

let masklayer = CAShapeLayer()
masklayer.frame = bounds
masklayer.path = maskPath.cgPath
cell?.layer.mask = masklayer

*bounds是重点,赋值错误会有UI上的bug

你可能感兴趣的:(swift 切指定的圆角UIRectCorner)