17.IBDesignable扩展Inspector面板属性

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
        }
    }
}

你可能感兴趣的:(17.IBDesignable扩展Inspector面板属性)