Class
DSMaxTextLengthInputMask
public class DSMaxTextLengthInputMask: DSInputMask
An input mask, when assigned to a DSTextField, will enforce use of a maximum number of characters allowed.
let textField = DSTextField()
textField.inputMask = DSMaxTextLengthInputMask(maxTextLength: 8)
Relationships
Conforms To
DSInputMask
A masking object that controls what can be legally typed into a DSTextField and handles type formatting while that typing takes place. They do not validate but often "partner" up with validation rules.
Initializers
init(maxTextLength:)
public init(maxTextLength: Int)
Initializer.
Parameters
Name | Type | Description |
---|---|---|
maxTextLength | Int |
The maximum number of characters allowed |
Properties
Methods
shouldAllow(replacementString:resultingString:)
public func shouldAllow(replacementString string: String, resultingString: String) -> Bool
Only allow max number of chanracters.
applyFormattingMask(to:)
public func applyFormattingMask(to text: String) -> String