rishi420 / ExpandableTableView

This subclass of UITableView makes the Headers to expand or collapse.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ExpandableTableView

GitHub license

This subclass of UITableView makes the Headers to expand or collapse.

Setup

Latest code uses Xcode 8
For Xcode 7.2 download older release from https://github.com/rishi420/ExpandableTableView/releases

Simply drag and drop the "ExpandableTableView" directory in your project. This directory has 4 files.

  1. ExpandableTableView.h
  2. ExpandableTableView.m
  3. HeaderView.h
  4. HeaderView.m

How to use

  1. Change your UITableView class to ExpandableTableView class in storyboard.
  2. #import "ExpandableTableView.h"
  3. create an IBOutlet of ExpandableTableView
  4. In numberOfRowsInSection call totalNumberOfRows:inSection:
  5. call headerWithTitle:totalRows:inSection: in viewForHeaderInSection

Features

  • To make all Headers start with collapsed state use allHeadersInitiallyCollapsed
  • To make all Headers start with collapsed state execpt one section use initiallyExpandedSection
  • To expand only one section at a time use singleSelectionEnable

About

This subclass of UITableView makes the Headers to expand or collapse.

License:MIT License


Languages

Language:Objective-C 100.0%