完善任务流程、键盘适配与页面交互
This commit is contained in:
66
Pods/IQTextInputViewNotification/README.md
generated
Normal file
66
Pods/IQTextInputViewNotification/README.md
generated
Normal file
@ -0,0 +1,66 @@
|
||||
# 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.
|
||||
Reference in New Issue
Block a user