Skip to content

ElectricPeelSoftware/EPSStaticTableViewController

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EPSStaticTableViewController

EPSStaticTableViewController is a subclass of UITableViewController that makes it easy to set up table views with static content.

Usage

To use EPSStaticTableViewController, subclass it and override these methods:

- (NSArray *)identifiers

In this method, return an array of arrays of NSString objects. Each inner array represents one section of the table view. For example, returning

@[ @[ @"One", @"Two" ], @[ @"A" ], @[ @"X", @"Y", @"Z" ] ]

will result in a table view with three sections, containing two, one, and three rows, respectively.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowWithIdentifier:(NSString *)identifier indexPath:(NSIndexPath *)indexPath

This method replaces the UITableViewDelegate method tableView:cellForRowAtIndexPath:, making it so that you can use identifier to decide how to set up the cell, instead of using indexPath.

- (void)tableView:(UITableView *)tableView didSelectRowWithIdentifier:(NSString *)identifier indexPath:(NSIndexPath *)indexPath

This method replaces the UITableViewDelegate method tableView:didSelectRowAtIndexPath:, making it so that you can use identifier to decide what action to take, instead of using indexPath.

Installation

EPSStaticTableVIewController is available through CocoaPods, to install it simply add the following line to your Podfile:

pod "EPSStaticTableViewController"

Alternatively, include EPSStaticTableViewController.h and EPSStaticTableViewController.m in your project.

License

EPSStaticTableViewController is available under the MIT license. See the LICENSE file for more info.

About

A subclass of UITableViewController that makes it easy to set up a UITableView with static content.

Resources

License

Stars

Watchers

Forks

Packages

No packages published