17.IBDesignable扩展Inspector面板属性

2016-04-13  本文已影响19人  noonez
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
        }
    }
}
上一篇下一篇

猜你喜欢

热点阅读