https://github.com/hackiftekhar/iqkeyboardnotification
Lightweight library to observe keyboard events with ease.
https://github.com/hackiftekhar/iqkeyboardnotification
Last synced: over 1 year ago
JSON representation
Lightweight library to observe keyboard events with ease.
- Host: GitHub
- URL: https://github.com/hackiftekhar/iqkeyboardnotification
- Owner: hackiftekhar
- License: mit
- Created: 2024-07-21T08:26:11.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T14:06:24.000Z (over 1 year ago)
- Last Synced: 2025-03-10T15:17:36.906Z (over 1 year ago)
- Language: Swift
- Size: 330 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# IQKeyboardNotification
Lightweight library to observe keyboard events with ease.
[](https://travis-ci.org/hackiftekhar/IQKeyboardNotification)
[](https://cocoapods.org/pods/IQKeyboardNotification)
[](https://cocoapods.org/pods/IQKeyboardNotification)
[](https://cocoapods.org/pods/IQKeyboardNotification)

## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
## Installation
IQKeyboardNotification is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'IQKeyboardNotification'
```
## Usage
To observe keyboard events, subscribe to the keyboard events:-
```swift
import IQKeyboardNotification
class ViewController: UIViewController {
private let keyboard: IQKeyboardNotification = .init()
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// Subscribe
keyboard.subscribe(identifier: "YOUR_UNIQUE_IDENTIFIER") { event, frame in
print(frame)
// Write your own logic here based on event and keyboard frame
}
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
// Unsubscribe
keyboard.unsubscribe(identifier: "YOUR_UNIQUE_IDENTIFIER")
}
}
```
## Author
Iftekhar Qurashi hack.iftekhar@gmail.com
## Flow

## License
IQKeyboardNotification is available under the MIT license. See the LICENSE file for more info.