Giter Site home page Giter Site logo

irons163 / irhierarchytreetableview Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 238 KB

IRHierarchyTreeTableView is a powerful hierarchy tree for iOS.

License: MIT License

Objective-C 100.00%
hierarchy hierarchyviewer hierarchy-viewer tree ios objective-c tableview

irhierarchytreetableview's Introduction

Build Status Platform

IRHierarchyTreeTableView

  • IRHierarchyTreeTableView is a powerful hierarchy tree for iOS.

Features

  • Clear component of Hierarchy Tree.
  • Fold and expand smoothly.
  • Friendly UI.

Install

Git

  • Git clone this project.
  • Copy this project into your own project.
  • Add the .xcodeproj into you project and link it as embed framework.

Options

  • You can remove the ScreenShots folder.

Cocoapods

  • Not support yet.

Usage

Basic

  • Implement from codes:
    self.tableView = [[BranchTableIView alloc] init];
    self.tableView.delegate = self;
    
    Device *devicebranch1 = [[Device alloc] init];
    devicebranch1.name = @"branch1";
    Device *devicebranch2 = [[Device alloc] init];
    devicebranch2.name = @"branch2";
    Device *devicebranch3 = [[Device alloc] init];
    devicebranch3.name = @"branch3";
    Device *devicebranch4 = [[Device alloc] init];
    devicebranch4.name = @"branch4";
    Device *devicebranch5 = [[Device alloc] init];
    devicebranch5.name = @"branch5";
    Device *deviceleaf = [[Device alloc] init];
    deviceleaf.name = @"leaf";
    Device *deviceleaf2 = [[Device alloc] init];
    deviceleaf2.name = @"leaf2";
    Device *deviceleaf3 = [[Device alloc] init];
    deviceleaf3.name = @"leaf3";
    Device *deviceleaf4 = [[Device alloc] init];
    deviceleaf4.name = @"leaf4";
    Device *deviceleaf5 = [[Device alloc] init];
    deviceleaf5.name = @"leaf5";
    Device *deviceleaf6 = [[Device alloc] init];
    deviceleaf6.name = @"leaf6";
    Device *deviceleaf7 = [[Device alloc] init];
    deviceleaf7.name = @"leaf7";
    Device *deviceleaf8 = [[Device alloc] init];
    deviceleaf8.name = @"leaf8";
    Device *deviceleaf9 = [[Device alloc] init];
    deviceleaf9.name = @"leaf9";
    Device *deviceleaf10 = [[Device alloc] init];
    deviceleaf10.name = @"leaf10";
    Device *deviceleaf11 = [[Device alloc] init];
    deviceleaf11.name = @"leaf11";
    Device *deviceleaf12 = [[Device alloc] init];
    deviceleaf12.name = @"leaf12";
    
    branch = [[Branch alloc] initWithTableView:self.tableView];
    Branch *branch1 = [[Branch alloc] initWithDevice:devicebranch1];
    Branch *branch2 = [[Branch alloc] initWithDevice:devicebranch2];
    Branch *branch3 = [[Branch alloc] initWithDevice:devicebranch3];
    Branch *branch4 = [[Branch alloc] initWithDevice:devicebranch4];
    Branch *branch5 = [[Branch alloc] initWithDevice:devicebranch5];
    Leaf *leaf = [[Leaf alloc] initWithDevice:deviceleaf];
    Leaf *leaf2 = [[Leaf alloc] initWithDevice:deviceleaf2];
    Leaf *leaf3 = [[Leaf alloc] initWithDevice:deviceleaf3];
    Leaf *leaf4 = [[Leaf alloc] initWithDevice:deviceleaf4];
    Leaf *leaf5 = [[Leaf alloc] initWithDevice:deviceleaf5];
    Leaf *leaf6 = [[Leaf alloc] initWithDevice:deviceleaf6];
    Leaf *leaf7 = [[Leaf alloc] initWithDevice:deviceleaf7];
    Leaf *leaf8 = [[Leaf alloc] initWithDevice:deviceleaf8];
    Leaf *leaf9 = [[Leaf alloc] initWithDevice:deviceleaf9];
    Leaf *leaf10 = [[Leaf alloc] initWithDevice:deviceleaf10];
    Leaf *leaf11 = [[Leaf alloc] initWithDevice:deviceleaf11];
    Leaf *leaf12 = [[Leaf alloc] initWithDevice:deviceleaf12];
    
    FunctionModelBranchItem *branchItem = [[FunctionModelBranchItem alloc] initWithRowCount:1];
    [model addItem:branchItem];
    [branch add:leaf];
    [branch add:branch1];
    [branch add:leaf2];
    [branch1 add:branch2];
    [branch1 add:leaf3];
    [branch1 add:leaf4];
    [branch2 add:leaf5];
    [branch2 add:leaf6];
    [branch2 add:branch3];
    [branch3 add:leaf7];
    [branch3 add:leaf8];
    [branch2 add:branch4];
    [branch4 add:leaf9];
    [branch2 add:branch5];
    [branch5 add:leaf10];
    [branch5 add:leaf11];
    [branch5 add:leaf12];
    
    [self.view addSubview:self.tableView];
  • Implement from UI: Make a UITableView extand class with BranchTableIView.

Advanced settings

IRHierarchyTreeTableView can nice combine with another powerful tableview/collectionview framework:IRCollectionTableViewModel.

  • Sample as below, you can customize your ViewModel:
    self.tableView = [[BranchTableIView alloc] init];
    model = [[Model alloc] init];
    model.delegate = self;
    self.tableView.dataSource = model;

Screenshots

Demo1 Demo2
Demo1 Demo2
Demo3 Demo4
Demo3 Demo4

irhierarchytreetableview's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.