rishi420 / ExpandableTableView

This subclass of UITableView makes the Headers to expand or collapse.
MIT License
19 stars 5 forks source link

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