Skip to content

Commit a59f349

Browse files
committed
Update README.md
1 parent 1bba4af commit a59f349

File tree

1 file changed

+60
-3
lines changed

1 file changed

+60
-3
lines changed

README.md

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,61 @@
1-
RxKeyboard
2-
==========
1+
# RxKeyboard
32

4-
Reactive keyboard in iOS
3+
![Swift](https://img.shields.io/badge/Swift-3.0-orange.svg)
4+
[![CocoaPods](http://img.shields.io/cocoapods/v/RxKeyboard.svg)](https://cocoapods.org/pods/RxKeyboard)
5+
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
6+
7+
RxKeyboard provides a reactive way of keyboard handling. Forget about `UIKeyboardWillShow` and `UIKeyboardWillHide`. It also perfectly works with `UIScrollViewKeyboardDismissMode.interactive`.
8+
9+
![rxkeyboard mov](https://cloud.githubusercontent.com/assets/931655/19223553/82b3fa5a-8ead-11e6-8cb5-ec13ee09eb50.gif)
10+
11+
## At a Glance
12+
13+
Observing keyboard frame:
14+
15+
```swift
16+
RxKeyboard.instance.frame
17+
.drive(onNext: { frame in
18+
print(frame)
19+
})
20+
.addDisposableTo(disposeBag)
21+
```
22+
23+
Observing keyboard visible height:
24+
25+
```swift
26+
RxKeyboard.instance.visibleHeight
27+
.drive(onNext: { keyboardVisibleHeight in
28+
toolbarBottomConstraint.constant = -1 * keyboardVisibleHeight
29+
})
30+
.addDisposableTo(disposeBag)
31+
```
32+
33+
> **Note**: In real world, you should use `setNeedsLayout` and `layoutIfNeeded`. See the [demo project](https://github.com/devxoul/RxKeyboard/blob/master/Demo/Sources/ViewControllers/ViewController.swift#L62-L70) for example.
34+
35+
## Dependencies
36+
37+
- [RxSwift](https://github.com/ReactiveX/RxSwift) (= 3.0.0-beta.2)
38+
- [RxCocoa](https://github.com/ReactiveX/RxSwift) (= 3.0.0-beta.2)
39+
40+
## Requirements
41+
42+
- Swift 3
43+
- iOS 8+
44+
45+
## Installation
46+
47+
- **Using [CocoaPods](https://cocoapods.org)**:
48+
49+
```ruby
50+
pod 'RxKeyboard', '~> 0.1'
51+
```
52+
53+
- **Using [Carthage](https://github.com/Carthage/Carthage)**:
54+
55+
```
56+
github "devxoul/RxKeyboard" ~> 0.1
57+
```
58+
59+
## License
60+
61+
RxKeyboard is under MIT license.

0 commit comments

Comments
 (0)