{"id":1820,"url":"https://github.com/RxSwiftCommunity/RxKeyboard","last_synced_at":"2025-08-02T04:32:37.008Z","repository":{"id":11746510,"uuid":"70429268","full_name":"RxSwiftCommunity/RxKeyboard","owner":"RxSwiftCommunity","description":"Reactive Keyboard in iOS","archived":false,"fork":false,"pushed_at":"2023-11-23T16:38:41.000Z","size":192,"stargazers_count":1610,"open_issues_count":25,"forks_count":176,"subscribers_count":42,"default_branch":"master","last_synced_at":"2025-07-24T07:32:47.025Z","etag":null,"topics":["ios","keyboard","rxswift","swift"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RxSwiftCommunity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-10-09T20:42:20.000Z","updated_at":"2025-07-14T15:44:01.000Z","dependencies_parsed_at":"2024-01-07T22:23:31.516Z","dependency_job_id":"44c147e2-ba7b-42f1-bea4-e1dc0fdad3a0","html_url":"https://github.com/RxSwiftCommunity/RxKeyboard","commit_stats":{"total_commits":142,"total_committers":27,"mean_commits":"5.2592592592592595","dds":0.4577464788732394,"last_synced_commit":"63f6377975c962a1d89f012a6f1e5bebb2c502b7"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/RxSwiftCommunity/RxKeyboard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FRxKeyboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FRxKeyboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FRxKeyboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FRxKeyboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RxSwiftCommunity","download_url":"https://codeload.github.com/RxSwiftCommunity/RxKeyboard/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RxSwiftCommunity%2FRxKeyboard/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268272319,"owners_count":24223781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ios","keyboard","rxswift","swift"],"created_at":"2024-01-05T20:15:56.588Z","updated_at":"2025-08-02T04:32:36.728Z","avatar_url":"https://github.com/RxSwiftCommunity.png","language":"Swift","funding_links":[],"categories":["Swift","Reactive Programming","Libraries"],"sub_categories":["Other free courses","Prototyping","Other Parsing"],"readme":"# RxKeyboard\n\n![Swift](https://img.shields.io/badge/Swift-5.0-orange.svg)\n[![CocoaPods](http://img.shields.io/cocoapods/v/RxKeyboard.svg)](https://cocoapods.org/pods/RxKeyboard)\n[![Build Status](https://travis-ci.org/RxSwiftCommunity/RxKeyboard.svg?branch=master)](https://travis-ci.org/RxSwiftCommunity/RxKeyboard)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\nRxKeyboard provides a reactive way of observing keyboard frame changes. Forget about keyboard notifications. It also perfectly works with `UIScrollViewKeyboardDismissMode.interactive`.\n\n![rxkeyboard-message](https://cloud.githubusercontent.com/assets/931655/22062707/625eea7a-ddbe-11e6-9984-529abae1bd1a.gif)\n![rxkeyboard-textview](https://cloud.githubusercontent.com/assets/931655/19223656/14bd915c-8eb0-11e6-93ea-7618fc9c5d81.gif)\n\n## Getting Started\n\nRxKeyboard provides two [`Driver`](https://github.com/ReactiveX/RxSwift/blob/master/Documentation/Traits.md#driver)s.\n\n```swift\n/// An observable keyboard frame.\nlet frame: Driver\u003cCGRect\u003e\n\n/// An observable visible height of keyboard. Emits keyboard height if the keyboard is visible\n/// or `0` if the keyboard is not visible.\nlet visibleHeight: Driver\u003cCGFloat\u003e\n\n/// Same with `visibleHeight` but only emits values when keyboard is about to show. This is\n/// useful when adjusting scroll view content offset.\nlet willShowVisibleHeight: Driver\u003cCGFloat\u003e\n```\n\nUse `RxKeyboard.instance` to get singleton instance.\n\n```swift\nRxKeyboard.instance\n```\n\nSubscribe `RxKeyboard.instance.frame` to observe keyboard frame changes.\n\n```swift\nRxKeyboard.instance.frame\n  .drive(onNext: { frame in\n    print(frame)\n  })\n  .disposed(by: disposeBag)\n```\n\n## Tips and Tricks\n\n- \u003ca name=\"tip-content-inset\" href=\"#tip-content-inset\"\u003e🔗\u003c/a\u003e **I want to adjust `UIScrollView`'s `contentInset` to fit keyboard height.**\n\n    ```swift\n    RxKeyboard.instance.visibleHeight\n      .drive(onNext: { [scrollView] keyboardVisibleHeight in\n        scrollView.contentInset.bottom = keyboardVisibleHeight\n      })\n      .disposed(by: disposeBag)\n    ```\n\n- \u003ca name=\"tip-content-offset\" href=\"#tip-content-offset\"\u003e🔗\u003c/a\u003e **I want to adjust `UIScrollView`'s `contentOffset` to fit keyboard height.**\n\n    ```swift\n    RxKeyboard.instance.willShowVisibleHeight\n      .drive(onNext: { [scrollView] keyboardVisibleHeight in\n        scrollView.contentOffset.y += keyboardVisibleHeight\n      })\n      .disposed(by: disposeBag)\n    ```\n\n- \u003ca name=\"tip-toolbar\" href=\"#tip-toolbar\"\u003e🔗\u003c/a\u003e **I want to make `UIToolbar` move along with the keyboard in an interactive dismiss mode. (Just like the wonderful GIF above!)**\n\n    If you're not using Auto Layout:\n\n    ```swift\n    RxKeyboard.instance.visibleHeight\n      .drive(onNext: { [toolbar, view] keyboardVisibleHeight in\n        toolbar.frame.origin.y = view.frame.height - toolbar.frame.height - keyboardVisibleHeight\n      })\n      .disposed(by: disposeBag)\n    ```\n\n    If you're using Auto Layout, you have to capture the toolbar's bottom constraint and set `constant` to keyboard visible height.\n\n    ```swift\n    RxKeyboard.instance.visibleHeight\n      .drive(onNext: { [toolbarBottomConstraint] keyboardVisibleHeight in\n        toolbarBottomConstraint.constant = -1 * keyboardVisibleHeight\n      })\n      .disposed(by: disposeBag)\n    ```\n\n    \u003e **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.\n\n- Anything else? Please open an issue or make a Pull Request.\n    \n## Dependencies\n\n- [RxSwift](https://github.com/ReactiveX/RxSwift) (\u003e= 6.0)\n- [RxCocoa](https://github.com/ReactiveX/RxSwift) (\u003e=6.0)\n\n## Requirements\n\n- Swift 5.1\n- iOS 9+\n\n## Contributing\n\nIn development, RxKeyboard manages dependencies with Swift Package Manager. Use the command below in order to generate a Xcode project file. Note that `.xcodeproj` file changes are not tracked via git.\n\n```console\n$ swift package generate-xcodeproj\n```\n\n## Installation\n\n- **Using [CocoaPods](https://cocoapods.org)**:\n\n    ```ruby\n    pod 'RxKeyboard'\n    ```\n\n- **Using [Carthage](https://github.com/Carthage/Carthage)**:\n\n    ```\n    binary \"https://raw.githubusercontent.com/RxSwiftCommunity/RxKeyboard/master/RxKeyboard.json\"\n    ```\n\n    ⚠️ With Carthage, RxKeyboard only supports binary installation:\n    * 0.9.2\n        * Xcode 10.1 (10B61)\n        * Swift 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1)\n    * 0.9.0\n        * Xcode 10 (10A255)\n        * Swift 4.2 (swiftlang-1000.11.37.1 clang-1000.11.45.1)\n    * 0.8.2\n        * Xcode 9.3 (9E145)\n        * Swift 4.1.0 (swiftlang-902.0.48 clang-902.0.37.1)\n    * 0.7.1\n        * Xcode 9.1 (9B55)\n        * Swift 4.0.2 (swiftlang-900.0.69.2 clang-900.0.38)\n    * 0.7.0\n        * 9.0.1 (9A1004)\n        * Swift 4.0 (swiftlang-900.0.65.2 clang-900.0.37)\n\n## License\n\nRxKeyboard is under MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRxSwiftCommunity%2FRxKeyboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRxSwiftCommunity%2FRxKeyboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRxSwiftCommunity%2FRxKeyboard/lists"}