@IBInspectable with enum?

前端 未结 7 1404
旧时难觅i
旧时难觅i 2020-12-24 04:11

I\'d like to create @IBInspectable element as you see at the picture below :

\"enter

7条回答
  •  被撕碎了的回忆
    2020-12-24 04:46

    My solution was to do :

    @IBInspectable  
    var keyboardType = UIKeyboardType.default.rawValue {
            didSet { 
                 textField.keyboardType = UIKeyboardType(rawValue: keyboardType)! 
            }
    }
    

    On the IB itself, you will need to set an int in the keyboardType field

提交回复
热议问题