如何在storyboard中,无需运行就可以即时的浏览view的的layer属性更改


列入增加了圆角,boardcolor,等等。之前看到一篇文章说了方法,时间长了又忘记了。有哪位大神告知

storyboard ios autolayout

kinov 9 years, 7 months ago

@IBDesignable
class MyCustomView: UIView {
@IBInspectable var textColor: UIColor
@IBInspectable var borderColor: UIColor = UIColor.whiteColor() {


 didSet { layer.borderColor = borderColor.CGColor }

}

@IBInspectable var iconHeight: CGFloat
/* ... */
}

https://developer.apple.com/library/ios/recipes/xcode_help-IB_objects_...

http://www.cocoachina.com/industry/20140619/8883.html

https://github.com/WeHeartSwift/IBDesignable-Demo

cdqclq answered 9 years, 7 months ago

Your Answer