MDCTextInputCharacterCounter

@protocol MDCTextInputCharacterCounter <NSObject>

Protocol for custom character counters.

Instead of relying on the default character count which is naive (counts each character regardless of context), this object can instead choose to do sophisticated counting (ie: ignoring whitespace, ignoring url strings, ignoring usernames, etc).

  • Returns the count of characters for the text field.

    Declaration

    Objective-C

    - (NSUInteger)characterCountForTextInput:
        (nullable UIView<MDCTextInput> *)textInput;

    Parameters

    textInput

    The text input to count from.

    Return Value

    The count of characters.