Giter Club home page Giter Club logo

ratreeview's Introduction

RATreeView (iOS 5.0+)

Twitter: @raaugustyniak License: MIT CocoaPods Build Status

Introduction

RATreeView is a class designed to provide easy and pleasant way to work with tree views on iOS. It works as a wrapper for the UITableView, defining its own delegate and data source methods which make working with tree data structures really easy.

RATreeView is highly customizable and has a lot of features.

Installation

CocoaPods

CocoaPods is the recommended way to add RATreeView to your project.

  1. Add additional entry to your Podfile.
pod "RATreeView", "~> 0.9.2"
  1. Install Pod(s) running pod install command.
  2. Include RATreeView using #import <RATreeView.h>.

###Source files

  1. Downloaded the latest version of the library using link.
  2. Copy content of the downloaded (and unzipped) zip file into your project by dragging it into Project's navigator files structure.

Requirements

  • Xcode 5
  • iOS 5
  • ARC
  • QuartzCore

Usage

Check out the demo for example usage of library. Make sure you read the RATreeView documentation on Cocoa Docs.

Basics

  1. Add following import in file of your project when you want to use RATreeView:

    // In case you are using RATreeView with CocoaPods
    #import<RATreeView.h>
    // In case you are using RATreeView by simply copying 
    // source files of the RATreeView into your project
    #import ""RATreeView.h"
  2. Simplest way to initialize and configure RATreeView:

    RATreeView *treeView = [[RATreeView alloc] initWithFrame:self.view.bounds];
    treeView.delegate = self;
    treeView.dataSource = self;       
    [self.view addSubview:treeView];
    [treeView reloadData];
  3. Implement required methods of the RATreeView's data source:

    - (NSInteger)treeView:(RATreeView *)treeView numberOfChildrenOfItem:(id)item
    {
        return item ? 3 : 0;
    }
    - (UITableViewCell *)treeView:(RATreeView *)treeView cellForItem:(id)item treeNodeInfo:(RATreeNodeInfo *)treeNodeInfo
    {
       // create and configure cell for *item*
       return cell
    }
    - (id)treeView:(RATreeView *)treeView child:(NSInteger)index ofItem:(id)item
    {
       return @(index);
    }

Documentation

Documentation is available on CocoaPods.

Author

RATreeView was created by Rafał Augustyniak. You can find me on twitter (@RaAugustyniak).

Release Notes

Version 0.9.2

  • Fixed bug in endUpdates method.

Version 0.9.1

  • Fixed behaviour of treeView:willSelectRowForItem: delegate method.

Version 0.9.0

  • Added possiblity to change content of the RATreeView dynamically. Possible row operations:
    • additions
    • deletions
    • repositions
  • Added additional 'cell accessing' methods.
  • Removed RATreeNodeInfo class.
  • Added additional instance methods in RATreeView which substitute functionality provided by RATreeNodeInfo class.
  • Bug fixes.

License

MIT licensed, Copyright (c) 2014 Rafał Augustyniak, @RaAugustyniak

ratreeview's People

Contributors

augustyniak avatar daikini avatar antonholmquist avatar qoolloop avatar dumoko avatar

Watchers

ed1son 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.