iOS Developer Library

Developer

UIKit Framework Reference UITextInputMode Class Reference

Options
Deployment Target:

On This Page
Language:

UITextInputMode

Inherits From


Conforms To


Import Statement


Swift

import UIKit

Objective-C

@import UIKit;

Availability


Available in iOS 4.2 and later

An instance of the UITextInputMode class represents the current text-input mode. You can use this object to determine the primary language currently being used for text input.

  • Returns an instance representing the current text-input mode.

    Declaration

    Objective-C

    + (UITextInputMode *)currentInputMode

    Return Value

    An object representing the current input mode or nil if this object is not set by the text input system.

    Import Statement

    Objective-C

    @import UIKit;

    Availability

    Available in iOS 4.2 and later

    Deprecated in iOS 7.0

  • Returns the active text-input modes.

    Declaration

    Swift

    class func activeInputModes() -> [AnyObject]

    Objective-C

    + (NSArray *)activeInputModes

    Discussion

    Each element in the array is an instance of UITextInputMode. Returns an empty array if no such instances have been set by the text input system.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 5.0 and later

  • The primary language, if any, of the input mode.

    Declaration

    Swift

    var primaryLanguage: String? { get }

    Objective-C

    @property(nonatomic, readonly, retain) NSString *primaryLanguage

    Discussion

    The value of this property is a BCP 47 language code such as “es”, “en-US”, or “fr-CA”.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 4.2 and later