Skip to content

Commit 7668dd1

Browse files
committed
Add a documentation for gestureView API
1 parent 347d29d commit 7668dd1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,16 @@ RxKeyboard.instance.frame
8989

9090
> **Note**: In real world, you should use `setNeedsLayout()` and `layoutIfNeeded()` with animation block. See the [example project](https://github.com/RxSwiftCommunity/RxKeyboard/blob/master/Example/Sources/ViewControllers/MessageListViewController.swift#L92-L105) for example.
9191

92+
- <a name="tip-app-extension" href="#tip-app-extension">🔗</a> **I want to use RxKeyboard in App Extension.**
93+
94+
App Extesion doesn't allow the `UIApplication.shared` API so the pan gesture recognizer cannot automatically track the interactive keybord dismissing. You have to do something manually in the App Extension target: setting `gestureView`.
95+
96+
```swift
97+
// ShareViewController.swift
98+
RxKeyboard.instance.gestureView = self.view // add this line on `viewDidLoad()`
99+
RxKeyboard.instance.visibleHeight.drive(...)
100+
```
101+
92102
- Anything else? Please open an issue or make a Pull Request.
93103

94104
## Dependencies

0 commit comments

Comments
 (0)