iOS Developer Library

Developer

UIKit Framework Reference UIInputView Class Reference

Options
Deployment Target:

On This Page
Language:

UIInputView

The UIInputView class is designed to match the appearance of the standard system keyboard when used as an input view with a responder. When defining your own custom input views or input accessory views, you can use a UIInputView object as the root view and add any subviews you want to create your input view. The input view and its subviews receive tinting and blur effects based on the options you specify at initialization time.

Inheritance


Import Statement


Swift

import UIKit

Objective-C

@import UIKit;

Availability


Available in iOS 7.0 and later.
  • Initializes and returns an input view using the specified style information.

    Declaration

    Swift

    init(frame frame: CGRect, inputViewStyle inputViewStyle: UIInputViewStyle)

    Objective-C

    - (instancetype)initWithFrame:(CGRect)frame inputViewStyle:(UIInputViewStyle)inputViewStyle

    Parameters

    frame

    The frame rectangle for the view, measured in points. The origin of the frame is relative to the superview in which you plan to add it.

    inputViewStyle

    The style to use when altering the appearance of the view and its subviews. For a list of possible values, see UIInputViewStyle

    Return Value

    An initialized view object or nil if the view could not be initialized.

    Discussion

    This method is the designated initializer for the view and must be called by your subclass at initialization time.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 7.0 and later.

  • The style applied to the content of the view. (read-only)

    Declaration

    Swift

    var inputViewStyle: UIInputViewStyle { get }

    Objective-C

    @property(nonatomic, readonly) UIInputViewStyle inputViewStyle

    Discussion

    The style applies both to the current view and to any subviews that adopt the UIAppearance protocol, which includes all standard system views.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 7.0 and later.

  • Constants that indicate the appearance changes to make to an input view.

    Declaration

    Swift

    enum UIInputViewStyle : Int { case Default case Keyboard }

    Objective-C

    typedef enum : NSInteger { UIInputViewStyleDefault, UIInputViewStyleKeyboard, } UIInputViewStyle;

    Constants

    • Default

      UIInputViewStyleDefault

      Apply blur behaviors to the view so that it looks like it belongs with the keyboard. Do not apply tinting effects. This style is intended for input views that attach to the top of the keyboard and have a similar theme but that do not look like the keyboard itself.

      Available in iOS 7.0 and later.

    • Keyboard

      UIInputViewStyleKeyboard

      Apply both blur and tinting effects to the view to mimic the keyboard background. This style makes the input view match the keyboard appearance and can be used to replace or extend the keyboard.

      Available in iOS 7.0 and later.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 7.0 and later.