- iOS 8.0+
- Xcode 7.2
Just add the RXTreeContol folder to your project.
or use CocoaPods with Podfile:
pod 'RXTreeControl', '~> 0.0.2'
For using this library you have to install 'RxSwift', 'RxCocoa', 'RxBlocking',
Create reactive observing variable and add to them your custom model view
let itemTrees:Variable = Variable(treeController.treeArray as [TreeModelView])
You can call this method for reactive filling cell
itemTrees
.bindTo(tableView.rx_itemsWithCellIdentifier("Cell0")) { (row, element, cell) in
let tcell = cell as! TableViewCell
tcell.titleLabel?.text = "\(element.treeObject.title ) @ Level \(element.level)"
let colorRed = CGFloat(200 - element.level*10 ) / CGFloat(255.0)
let colorGreen = CGFloat(element.level*10 + 20) / CGFloat(255.0)
let colorBlue = CGFloat(100 - element.level*10 + 20) / CGFloat(255.0)
tcell.backgroundColor = UIColor(red: colorRed,
green: colorGreen,
blue: colorBlue,
alpha: CGFloat(1.0)
)
tcell.setNeedsLayout()
}
.addDisposableTo(disposeBag)
This listener change when you select table view cell and put to value your model view
tableView
.rx_modelSelected(TreeModelView)
.subscribeNext {value in
}
.addDisposableTo(disposeBag)
This listener change when you open subrow by index
tableView.rx_itemSubRowOpen.subscribeNext { (sourceIndex: NSIndexPath) -> Void in
}.addDisposableTo(disposeBag)
This listener change when you close subrow by index
tableView.rx_itemSubRowClosed
.subscribeNext { (sourceIndex: NSIndexPath) -> Void in
}.addDisposableTo(disposeBag)
This listener change when you close subrow by index
tableView.rx_itemRowMoved
.subscribeNext { (sourceIndex: NSIndexPath, destinationIndex: NSIndexPath) -> Void in
}.addDisposableTo(disposeBag)
This listener change when subrow move to root
tableView.rx_itemSubRowMovedToRoot
.subscribeNext { (sourceIndex: NSIndexPath, destinationIndex: NSIndexPath) -> Void in
}.addDisposableTo(disposeBag)
This listener show changing position when row move to subrow
tableView.rx_itemSubRowMoved
.subscribeNext { (sourceIndex: NSIndexPath, destinationIndex: NSIndexPath) -> Void in
}.addDisposableTo(disposeBag)
This listener returned last changed reorder row to subrow
tableView.rx_itemSubRowMove
.subscribeNext { (sourceIndex: NSIndexPath, destinationIndex: NSIndexPath) -> Void in
}.addDisposableTo(disposeBag)
This listener show changing position when row move to root
tableView.rx_itemMoveToRoot
.subscribeNext { (sourceIndex: NSIndexPath, destinationIndex: NSIndexPath) -> Void in
.addDisposableTo(disposeBag)
This listener returned last changed reorder row to root
tableView.rx_itemMovedToRoot
.subscribeNext { (sourceIndex: NSIndexPath, destinationIndex: NSIndexPath) -> Void in
}.addDisposableTo(disposeBag)
This block return custom view which highlight selected cell for reordering
tableView.rx_dataSource.viewBlock = { (cell:UITableViewCell, destinationIndex: NSIndexPath) -> UIView in
let view = UIView(frame: CGRectMake(0,cell.frame.height - 2 ,self.tableView.frame.width,2))
view.backgroundColor = UIColor.blueColor();
return view
}
This listener called when cell will viewed
tableView.rx_viewWillDisplayCell.subscribeNext { (cell: UITableViewCell, destinationIndex: NSIndexPath) -> Void in
}.addDisposableTo(disposeBag)
Adaptive tab bar is released under the MIT license. See LICENSE for details.
The project maintained by app development agency Ramotion Inc. See our other open-source projects or hire us to design, develop, and grow your product.
tree-view's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.