RSDTextFieldOptionsObject
public struct RSDTextFieldOptionsObject : RSDTextFieldOptions, Codable
RSDTextFieldOptionsObject defines the options for a text field.
-
A text validator that can be used to validate a string.
Declaration
Swift
public var textValidator: RSDTextValidator? -
The text presented to the user when invalid input is received.
Declaration
Swift
public var invalidMessage: String? -
The maximum length of the text users can enter. When the value of this property is 0, there is no maximum.
Declaration
Swift
public var maximumLength: Int -
Auto-capitalization type for the text field.
Declaration
Swift
public var autocapitalizationType: RSDTextAutocapitalizationType -
Auto-correction type for the text field.
Declaration
Swift
public var autocorrectionType: RSDTextAutocorrectionType -
Spell checking type for the text field.
Declaration
Swift
public var spellCheckingType: RSDTextSpellCheckingType -
Keyboard type for the text field.
Declaration
Swift
public var keyboardType: RSDKeyboardType -
Is the text field for password entry?
Declaration
Swift
public var isSecureTextEntry: Bool -
init(keyboardType:autocapitalizationType:isSecureTextEntry:maximumLength:spellCheckingType:autocorrectionType:)Default initializer.
Declaration
Swift
public init(keyboardType: RSDKeyboardType = .default, autocapitalizationType: RSDTextAutocapitalizationType = .none, isSecureTextEntry: Bool = false, maximumLength: Int = 0, spellCheckingType: RSDTextSpellCheckingType = .no, autocorrectionType: RSDTextAutocorrectionType = .no)Parameters
keyboardTypeKeyboard type for the text field.
autocapitalizationTypeAuto-capitalization type for the text field.
isSecureTextEntryIs the text field for password entry?
spellCheckingTypeSpell checking type for the text field.
autocorrectionTypeAuto-correction type for the text field.
-
Initialize from a
Decoder. The decoder uses string value keywords for all theIntbase enums defined by this struct where the keywords listed in the table below.Property Keywords keyboardType[ default
,asciiCapable
,numbersAndPunctuation
,URL
,"numberPad", "phonePad", "namePhonePad", "emailAddress", "decimalPad", "twitter", "webSearch", "asciiCapableNumberPad"] ||
autocapitalizationType| [none
,words
,sentences
,allCharacters
] | |spellCheckingType| [default
,no
,yes
] | |autocorrectionType| [default
,no
,yes
] |example:
let json = """ { "textValidator" : "[A:C]", "invalidMessage" : "You know me", "maximumLength" : 10, "autocapitalizationType" : "words", "keyboardType" : "asciiCapable", "isSecureTextEntry" : true } """.data(using: .utf8)! // our data in native (JSON) formatThrows
DecodingErrorDeclaration
Swift
public init(from decoder: Decoder) throwsParameters
decoderThe decoder to use to decode this instance.
-
Encode the result to the given encoder. This will encode the text options as a dictionary.
Throws
EncodingErrorDeclaration
Swift
public func encode(to encoder: Encoder) throwsParameters
encoderThe encoder to use to encode this instance.
View on GitHub
RSDTextFieldOptionsObject Structure Reference