@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
@IBDesignable
class MyCustomView: UIView {
@IBInspectable var textColor: UIColor
@IBInspectable var borderColor: UIColor = UIColor.whiteColor() {
@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