BTUIKTextFieldEditDelegate

Objective-C

@protocol BTUIKTextFieldEditDelegate <NSObject>

Swift

protocol BTUIKTextFieldEditDelegate : NSObjectProtocol

A protocol for receiving callbacks when a user edits text in a BTUITextField

  • The editDelegate receives this message when the user deletes a character, but before the deletion is applied to the text

    Declaration

    Objective-C

    - (void)textFieldWillDeleteBackward:(BTUIKTextField *)textField;

    Swift

    optional func textFieldWillDeleteBackward(_ textField: BTUIKTextField!)

    Parameters

    textField

    The text field

  • The editDelegate receives this message after the user deletes a character

    Declaration

    Objective-C

    - (void)textFieldDidDeleteBackward:(BTUIKTextField *)textField
                          originalText:(NSString *)originalText;

    Swift

    optional func textFieldDidDeleteBackward(_ textField: BTUIKTextField!, originalText: String!)

    Parameters

    textField

    The text field

    originalText

    The text of the text field before applying the deletion

  • The editDelegate receives this message when the user enters text, but before the text is inserted

    Declaration

    Objective-C

    - (void)textField:(BTUIKTextField *)textField willInsertText:(NSString *)text;

    Swift

    optional func textField(_ textField: BTUIKTextField!, willInsertText text: String!)

    Parameters

    textField

    The text field

    text

    The text that will be inserted

  • The editDelegate receives this message after the user enters text

    Declaration

    Objective-C

    - (void)textField:(BTUIKTextField *)textField didInsertText:(NSString *)text;

    Swift

    optional func textField(_ textField: BTUIKTextField!, didInsertText text: String!)

    Parameters

    textField

    The text field

    text

    The text that was inserted