iOS Developer Library

Developer

UIKit Framework Reference UITextInputDelegate Protocol Reference

Options
Deployment Target:

On This Page
Language:

UITextInputDelegate

The text input delegate acts as an intermediary between a document and the text input system, conveying notifications of pending or transpired changes in text and selection in the document.

The UIKit provides a private text input delegate, which it assigns at runtime to the inputDelegate property of the object whose class adopts the UITextInput protocol.

Inheritance


Not Applicable

Import Statement


Swift

import UIKit

Objective-C

@import UIKit;

Availability


Available in iOS 3.2 and later.
  • Tells the input delegate when text is about to change in the document. (required)

    Declaration

    Swift

    func textWillChange(_ textInput: UITextInput)

    Objective-C

    - (void)textWillChange:(id<UITextInput>)textInput

    Parameters

    textInput

    The document instance whose class adopts the UITextInput protocol.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 3.2 and later.

  • Tells the input delegate when text has changed in the document. (required)

    Declaration

    Swift

    func textDidChange(_ textInput: UITextInput)

    Objective-C

    - (void)textDidChange:(id<UITextInput>)textInput

    Parameters

    textInput

    The document instance whose class adopts the UITextInput protocol.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 3.2 and later.

  • Tells the input delegate when the selection is about to change in the document. (required)

    Declaration

    Swift

    func selectionWillChange(_ textInput: UITextInput)

    Objective-C

    - (void)selectionWillChange:(id<UITextInput>)textInput

    Parameters

    textInput

    The document instance whose class adopts the UITextInput protocol.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 3.2 and later.

  • Tells the input delegate when the selection has changed in the document. (required)

    Declaration

    Swift

    func selectionDidChange(_ textInput: UITextInput)

    Objective-C

    - (void)selectionDidChange:(id<UITextInput>)textInput

    Parameters

    textInput

    The document instance whose class adopts the UITextInput protocol.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 3.2 and later.