您的当前位置:首页17.IBDesignable扩展Inspector面板属性

17.IBDesignable扩展Inspector面板属性

2024-12-14 来源:哗拓教育
import UIKit

@IBDesignable
class ExtensionViewInspector: UIView {

    /*
    // Only override drawRect: if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func drawRect(rect: CGRect) {
        // Drawing code
    }
    */
    @IBInspectable var cornerRadius:CGFloat = 0 {
        didSet{
            layer.cornerRadius = cornerRadius
//            layer.masksToBounds = cornerRadius > 0
        }
    }
}
显示全文