RxKeyboard alternatives and similar libraries
Based on the "Reactive Programming" category.
Alternatively, view RxKeyboard alternatives based on common mentions on social networks and blogs.
-
JASONETTE-iOS
Native App over HTTP. Create your own native iOS app with nothing but JSON. -
ReactiveSwift
Streams of values over time by ReactiveCocoa group -
RxAlamofire
RxSwift wrapper around the elegant HTTP networking in Swift Alamofire -
OpenCombine
Open source implementation of Apple's Combine framework for processing values over time. -
RxCoordinator
Powerful navigation library for iOS based on the coordinator pattern. -
ReactiveKit
ReactiveKit is a collection of Swift frameworks for reactive and functional reactive programming. -
Interstellar
Simple and lightweight Functional Reactive Coding in Swift for the rest of us. :large_orange_diamond: -
RxAutomaton
RxSwift + State Machine, inspired by Redux and Elm. -
NSObject-Rx
Handy RxSwift extensions on NSObject, including rx_disposeBag. -
Hanson
Lightweight observations and bindings in Swift, with support for KVO and NotificationCenter. -
RxMediaPicker
A reactive wrapper built around UIImagePickerController. -
VueFlux
Unidirectional Data Flow State Management Architecture for Swift -
ReactiveCoreData
ReactiveCoreData (RCD) is an attempt to bring Core Data into the ReactiveCocoa (RAC) world. -
Verge
Verge is a faster and scalable state management library for UIKit and SwiftUI -
Reactor
๐ Unidirectional Data Flow using idiomatic Swift-inspired by Elm and Redux . -
ReactiveTask
Flexible, stream-based abstraction for launching processes -
TemplateKit
React-inspired framework for building component-based user interfaces in Swift. -
RxReduce
Lightweight framework that ease the implementation of a state container pattern in a Reactive Programming compliant way. -
LightweightObservable
A lightweight implementation of an observable sequence that you can subscribe to. -
RxMultipeer
A testable RxSwift wrapper around MultipeerConnectivity -
ReactiveArray
An array class implemented in Swift that can be observed using ReactiveCocoa's Signals. -
SimpleApiClient
A configurable api client based on Alamofire4 and RxSwift4 for iOS. -
ACKReactiveExtensions
Useful extensions for ReactiveCocoa -
Bindy
Simple, lightweight swift bindings with KVO support and easy to read syntax. -
BindKit
Two-way data binding framework for iOS. Only one API to learn. -
STDevRxExt
STDevRxExt contains some extension functions for RxSwift and RxCocoa which makes our live easy. -
RxAlamoRecord
Combines the power of the AlamoRecord and RxSwift libraries to create a networking layer that makes interacting with API's easier than ever reactively. -
RxOptional
RxSwift extentions for Swift optionals and "Occupiable" types -
Tokamak
React-like framework providing a declarative API for building native UI components with easy to use one-way data binding.
Scout APM - Leading-edge performance monitoring starting at $39/month
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of RxKeyboard or a related project?
README
RxKeyboard
RxKeyboard provides a reactive way of observing keyboard frame changes. Forget about keyboard notifications. It also perfectly works with UIScrollViewKeyboardDismissMode.interactive
.
Getting Started
RxKeyboard provides two Driver
s.
/// An observable keyboard frame.
let frame: Driver<CGRect>
/// An observable visible height of keyboard. Emits keyboard height if the keyboard is visible
/// or `0` if the keyboard is not visible.
let visibleHeight: Driver<CGFloat>
/// Same with `visibleHeight` but only emits values when keyboard is about to show. This is
/// useful when adjusting scroll view content offset.
let willShowVisibleHeight: Driver<CGFloat>
Use RxKeyboard.instance
to get singleton instance.
RxKeyboard.instance
Subscribe RxKeyboard.instance.frame
to observe keyboard frame changes.
RxKeyboard.instance.frame
.drive(onNext: { frame in
print(frame)
})
.disposed(by: disposeBag)
Tips and Tricks
๐ I want to adjust
UIScrollView
'scontentInset
to fit keyboard height.RxKeyboard.instance.visibleHeight .drive(onNext: { [scrollView] keyboardVisibleHeight in scrollView.contentInset.bottom = keyboardVisibleHeight }) .disposed(by: disposeBag)
๐ I want to adjust
UIScrollView
'scontentOffset
to fit keyboard height.RxKeyboard.instance.willShowVisibleHeight .drive(onNext: { [scrollView] keyboardVisibleHeight in scrollView.contentOffset.y += keyboardVisibleHeight }) .disposed(by: disposeBag)
๐ I want to make
UIToolbar
move along with the keyboard in an interactive dismiss mode. (Just like the wonderful GIF above!)If you're not using Auto Layout:
RxKeyboard.instance.visibleHeight .drive(onNext: { [toolbar, view] keyboardVisibleHeight in toolbar.frame.origin.y = view.frame.height - toolbar.frame.height - keyboardVisibleHeight }) .disposed(by: disposeBag)
If you're using Auto Layout, you have to capture the toolbar's bottom constraint and set
constant
to keyboard visible height.RxKeyboard.instance.visibleHeight .drive(onNext: { [toolbarBottomConstraint] keyboardVisibleHeight in toolbarBottomConstraint.constant = -1 * keyboardVisibleHeight }) .disposed(by: disposeBag)
Note: In real world, you should use
setNeedsLayout()
andlayoutIfNeeded()
with animation block. See the example project for example.Anything else? Please open an issue or make a Pull Request.
Dependencies
Requirements
- Swift 4
- iOS 8+
Contributing
In 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.
$ swift package generate-xcodeproj
Installation
Using CocoaPods:
pod 'RxKeyboard'
Using Carthage:
binary "https://raw.githubusercontent.com/RxSwiftCommunity/RxKeyboard/master/RxKeyboard.json"
โ ๏ธ With Carthage, RxKeyboard only supports binary installation:
- 0.9.2
- Xcode 10.1 (10B61)
- Swift 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1)
- 0.9.0
- Xcode 10 (10A255)
- Swift 4.2 (swiftlang-1000.11.37.1 clang-1000.11.45.1)
- 0.8.2
- Xcode 9.3 (9E145)
- Swift 4.1.0 (swiftlang-902.0.48 clang-902.0.37.1)
- 0.7.1
- Xcode 9.1 (9B55)
- Swift 4.0.2 (swiftlang-900.0.69.2 clang-900.0.38)
- 0.7.0
- 9.0.1 (9A1004)
- Swift 4.0 (swiftlang-900.0.65.2 clang-900.0.37)
- 0.9.2
License
RxKeyboard is under MIT license.
*Note that all licence references and agreements mentioned in the RxKeyboard README section above
are relevant to that project's source code only.