Latest 0.1.5
Homepage https://github.com/RxSwiftCommunity/RxBiBinding
License MIT
Platforms ios 10.0
Dependencies RxSwift, RxCocoa
Authors

Build Status
Carthage compatible
Version
License
Platform

Example

Binding between two ControlProperty

let disposeBag = DisposeBag()

var textFieldFirst = UITextField()
var textFieldSecond = UITextField()

(textFieldFirst.rx.text <-> textFieldSecond.rx.text).disposed(by: disposeBag)

Binding between two BehaviorRelay

let disposeBag = DisposeBag()

var textFirst = BehaviorRelay<String?>(value: "")
var textSecond = BehaviorRelay<String?>(value: "")

(textFirst <-> textSecond).disposed(by: disposeBag)

Binding between ControlProperty and BehaviorRelay

let disposeBag = DisposeBag()

var text = BehaviorRelay<String?>(value: "")
var textField = UITextField()

(textField.rx.text <-> text).disposed(by: disposeBag)

Binding between two NSObject

class TestClass: NSObject {
    @objc dynamic var string = "TestString"
}

let disposeBag = DisposeBag()
var test1 = TestClass()
var test2 = TestClass()

((test1, "string") <-> (test2, "string")).disposed(by: disposeBag)

Requirements

iOS >= 10

Installation

RxBiBinding is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'RxBiBinding'

Carthage

carthage update --platform ios

Thanks

This solution is based on ReactiveCocoa (Obj-C version)

License

RxBiBinding is available under the MIT license. See the LICENSE file for more info.
Copyright (c) RxSwiftCommunity

Latest podspec

{
    "name": "RxBiBinding",
    "version": "0.1.5",
    "summary": "Bidirectional binding. Inspired by ReactiveCocoa",
    "description": "Reactive bidirectional (two-way) binding between RxControlProperties and RxVariables. Of course you can use this library and for NSObject",
    "homepage": "https://github.com/RxSwiftCommunity/RxBiBinding",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Davarg": "[email protected]"
    },
    "source": {
        "git": "https://github.com/RxSwiftCommunity/RxBiBinding.git",
        "tag": "0.1.5"
    },
    "social_media_url": "https://twitter.com/Underbridgins",
    "platforms": {
        "ios": "10.0"
    },
    "swift_version": "4.0",
    "source_files": "RxBiBinding/Classes/**/*",
    "dependencies": {
        "RxSwift": [
            "~> 4.2"
        ],
        "RxCocoa": [
            "~> 4.2"
        ]
    }
}

Pin It on Pinterest

Share This