在我拥有的 Storyboard 中UITextField,我还创建了自定义类:
class WLTextField: UITextField {
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
layer.cornerRadius = 2
layer.masksToBounds = true
layer.borderColor = UIColor.grayColor().CGColor
layer.borderWidth = 1
}
}
然后将这个类附加到我的UITextField:
但是,Storyboard 中没有结果。我怎样才能做到这一点?我需要像@IBDesignables. 但是因为我知道我需要为每个文本字段设置什么,所以我不需要设置一个值然后在didSet.
我是否需要设置至少一个值才能在某些 UIView 上的 Storyboard 中进行实时更改?
