A lightweight data binding for components on iOS
A lightweight data binding for components on iOS, easy to use and does not have retain cycle.
- Fork project
- Checkout master branch
- Create Feature branch off of the master branch
- Create awesome feature/enhancement/bug-fix
- Optionally create Issue to discuss feature
- Submit pull request from your Feature branch to Binder's master branch
use_frameworks!
pod 'Binder'
Add Binder to you Cartfile
github "khuong291/Binder"
Install using
carthage update --platform ios
- Download and drop
/Binder
folder in your project. - You're done!
private let colorBinder: Binder<UIColor, ViewBindingType> = Binder(value: .white, type: .backgroundColor)
private let textBinder: Binder<String, LabelBindingType> = Binder(value: "Hello", type: .text)
colorBinder <-> [view1, view2, view3, view4]
textBinder <-> label1 <-> label2 <-> label3 <-> label4
colorBinder.value = .green
textBinder.value = "Green Color"
deinit {
colorBinder.remove()
textBinder.remove()
}
- iOS 9.0+
- Xcode 8.0+
- Swift 3.0+
Binder is released under the MIT license.
See LICENSE for details.