https://github.com/hackiftekhar/iqtextinputviewnotification
Easy UITextField / UITextView Event Subscription
https://github.com/hackiftekhar/iqtextinputviewnotification
Last synced: over 1 year ago
JSON representation
Easy UITextField / UITextView Event Subscription
- Host: GitHub
- URL: https://github.com/hackiftekhar/iqtextinputviewnotification
- Owner: hackiftekhar
- License: mit
- Created: 2024-07-22T07:08:06.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T14:14:58.000Z (over 1 year ago)
- Last Synced: 2025-03-10T15:17:36.929Z (over 1 year ago)
- Language: Swift
- Size: 284 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
# IQTextInputViewNotification
[](https://travis-ci.org/hackiftekhar/IQTextInputViewNotification)
[](https://cocoapods.org/pods/IQTextInputViewNotification)
[](https://cocoapods.org/pods/IQTextInputViewNotification)
[](https://cocoapods.org/pods/IQTextInputViewNotification)

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

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