Latest 0.0.2
Homepage https://github.com/Ramotion/tree-view
License MIT
Platforms ios 8.0, requires ARC
Dependencies RxSwift, RxCocoa, RxBlocking
Authors

CocoaPods
CocoaPods
codebeat badge
Swift 2.2
Twitter
Travis

Requirements

  • iOS 8.0+
  • Xcode 7.2

Installation

Just add the RXTreeContol folder to your project.

or use CocoaPods with Podfile:

pod 'RXTreeControl', '~> 0.0.2'

Usage

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)

Snapshots

Solution
Solution
Solution

Licence

Adaptive tab bar is released under the MIT license.
See LICENSE for details.

About

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.

Twitter URL
Twitter Follow

Latest podspec

{
    "name": "RXTreeControl",
    "version": "0.0.2",
    "summary": "Amazing reactive custom reorder menu",
    "homepage": "https://github.com/Ramotion/tree-view",
    "license": "MIT",
    "authors": {
        "Juri Vasylenko": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/Ramotion/tree-view.git",
        "tag": "0.0.2"
    },
    "source_files": "RXTreeControl/RXTreeControl/**/*.swift",
    "requires_arc": true,
    "dependencies": {
        "RxSwift": [],
        "RxCocoa": [],
        "RxBlocking": []
    }
}

Pin It on Pinterest

Share This