EnterpriseDS Documentation

Class DSMax​Text​Length​Input​Mask

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)
DSMaxTextLengthInputMask DSMaxTextLengthInputMask DSInputMask DSInputMask DSMaxTextLengthInputMask->DSInputMask

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(max​Text​Length:​)

public init(maxTextLength: Int)  

Initializer.

Parameters

max​Text​Length Int

The maximum number of characters allowed

Properties

keyboard​Type

public var keyboardType: UIKeyboardType?  

Allow any kind of characters

Methods

raw​Text(from:​)

public func rawText(from text: String) -> String  

The entered text.

should​Allow(replacement​String:​resulting​String:​)

public func shouldAllow(replacementString string: String, resultingString: String) -> Bool  

Only allow max number of chanracters.

apply​Formatting​Mask(to:​)

public func applyFormattingMask(to text: String) -> String