Overview
The UIView extensions provide per-view customization of keyboard management behavior through the.iq wrapper pattern. These extensions allow you to override global settings for specific text input views.
The .iq Wrapper Pattern
All extension properties are accessed through the .iq namespace on UIView instances:
Properties
Custom distance from keyboard for this specific text input view.If set to
UIView.defaultKeyboardDistance, the global keyboardDistance value from IQKeyboardManager.shared.keyboardDistance will be used. Otherwise, this value takes precedence.Note: Value cannot be negative. Negative values may cause unexpected behavior.Enable mode for this specific text input view.Controls whether keyboard management is enabled, disabled, or uses the default global setting for this view.Values:
.default- Use globalIQKeyboardManager.shared.isEnabledsetting.enabled- Force enable keyboard management for this view.disabled- Force disable keyboard management for this view
Available Properties Summary
| Property | Type | Default | Description |
|---|---|---|---|
distanceFromKeyboard | CGFloat | UIView.defaultKeyboardDistance | Custom keyboard distance for this view |
enableMode | IQEnableMode | .default | Enable/disable mode for this view |
Usage Examples
Custom Distance for Specific Fields
Disabling Keyboard Management for Custom Keyboards
Force Enable for Specific Fields
See Also
- UIScrollView Extensions - Scroll view specific extensions
- Configuration - Global keyboard manager settings
- IQKeyboardManager - Main keyboard manager class