Overview
IQKeyboardAppearanceConfiguration is a configuration class that manages keyboard appearance settings for text input views throughout your application. It allows you to override and standardize the keyboard appearance across all text fields and text views.
This class is marked with
@MainActor, so all property access must occur on the main thread.Class Declaration
Properties
Determines whether to override the keyboard appearance for all text input views. When set to
true, all text input views will use the appearance specified in the appearance property.The keyboard appearance to apply to all text input views when
overrideAppearance is enabled. This property accepts any value from the UIKeyboardAppearance enum.UIKeyboardAppearance Values
Theappearance property accepts the following UIKeyboardAppearance enum values:
| Value | Description |
|---|---|
.default | The default keyboard appearance for the current input trait settings |
.dark | A keyboard appearance suitable for a dark UI |
.light | A keyboard appearance suitable for a light UI |
.alert | Deprecated. Use .light instead |
Usage Examples
Basic Configuration
Integration with IQKeyboardManager
Conditional Appearance Based on Dark Mode
Disabling Override
Important Notes
The appearance is only applied when a text input view begins editing. Changing these properties while a keyboard is already visible will not take effect until the next text input view becomes active.
This class is unavailable in iOS App Extensions due to its dependency on UIApplication features.
See Also
- IQKeyboardAppearanceManager - The internal manager that applies these settings
- IQKeyboardManager - The main keyboard manager class