I am using keyboard selection in Swift for textfields and I need to show enum name (emailAdress...) in @IBInspectable instead of its Int number (0-6). How can I fix this?
public class TextFieldView: UIView{
enum KeyboardType: Int {
case normal
case asciiCapable
case numberPad
case phonePad
case emailAddress
case namePhonePad
}
@IBInspectable public var keyBoard: Int = 0 {
didSet {
let keyBoardType = KeyboardType(rawValue: keyBoard)
self.textField.keyboardType = UIKeyboardType.init(rawValue: keyBoardType!.rawValue)!
}
}