//
//  UIView+CCExtension.swift
//  SwiftProject
//
//  Created by Zhang, Joyce on 2024/2/25.
//

import Foundation
import UIKit

extension UIView {
    ///添加部分圆角（自动布局情况下，要在布局后使用）
    func addCorner(conrners: UIRectCorner , radius: CGFloat) {
        self.layoutIfNeeded()
        let maskPath = UIBezierPath(roundedRect: self.bounds, byRoundingCorners: conrners, cornerRadii: CGSize(width: radius, height: radius))
        let maskLayer = CAShapeLayer()
        maskLayer.frame = self.bounds
        maskLayer.path = maskPath.cgPath
        self.layer.mask = maskLayer
    }
}



 

