An iOS/Swift equivalent for Android's RxKotlin Plus, which makes binding RxSwift to views even easier.
This currently requires the lightweight fork of RxSwift here. The fork only adds Subject
and makes Observable
an open class. It is maintained. Eventually, it may no longer be necessary.
This package contains Khrysalis equivalents for usage with the Khrysalis Kotlin to Swift transpiler. You don't need to use Khrysalis for this package to be useful, however.
The core package, which contains some convenient extension functions for manipulating Observable
and Subject
.
Most important features:
ValueSubject<T>
- aBehaviorSubject
that guarantees an initial value. Also has the propertyvalue
for getting/setting.Subject.map
- allows bidirectional mapping of a subject.Observable.withWrite
- transforms anObservable
into aSubject
by providing some action to perform whenonNext
is called.
A package allowing easy HTTP calls in Rx style.
A package abstracting different types of images and video, allowing for easier binding to views.
Contains a bunch of functions for bidirectional binding of iOS views to Subject
s, as well as a DisposeBag
attached to a view's lifecycle.
Some sample features:
UIView.removed
- aDisposeBag
that is disposed when the view is removed from the hierarchyObservable.subscribeAutoDispose(UILabel, \UILabel.text)
- show the value in the given view and keep it updated, automatically disposed when the view is removed from the hierarchySubject<String>.bind(UITextField)
- bidirectional bind to the subject, automatically disposed when the view is removed from the hierarchyObservable<List<T>>.showIn(UICollectionView) { obs: Observable<T> -> UIView }
- Shows updating content in aUICollectionView
Adds bindings for the Cosmos library.
Adds bindings for LabeledToggle
from the XmlToXibRuntime.
Adds bindings for InputViewButton
from the XmlToXibRuntime using Khrysalis.
Adds bindings for SearchTextField.
An alternate way of handling view navigation in iOS. Essentially a replacement for ViewController
.
Built to be bare-bones, a ViewGenerator
has the following interface:
protocol ViewGenerator {
func generate(dependency: ViewControllerAccess): UIView
}
where ViewControllerAccess
is an interface for accessing an ViewController
and its callbacks.
You can then use a SwapView
to display a stack of view generators:
let myStack = ValueSubject<Array<ViewGenerator>>([])
myStack.showIn(swapView, viewControllerAccess)
Now, pushing and popping views onto the stack is really easy:
myStack.push(SomeViewGenerator("Test Data")) // push is a shortcut function
myStack.pop() // pop is a shortcut function
myStack.value = [MyViewGenerator(myStack)] // You can reset the whole stack easily
You may have noticed that this means we can use constructors in our views. This is one of the biggest advantages of using view generators.
This pattern was adopted from Android's RxKotlin Plus. You can read more there.
Extensions allowing convenient operations with the calendar from view generators.
Extensions allowing convenient requesting of images, video, and other media from view generators.
Extensions allowing convenient getting of location from view generators.