Skip to content

Commit

Permalink
Merge pull request #74 from huntermonk/patch-1
Browse files Browse the repository at this point in the history
Fix headers on README.md
  • Loading branch information
wtmoose committed Sep 6, 2017
2 parents 4efb04e + 805c6d0 commit ca47649
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Expand Up @@ -11,7 +11,7 @@ TLIndexPathTools is a small set of classes that can greatly simplify your table

TLIndexPathTools is as lightweight as you want it to be. Start small by using `TLIndexPathDataModel` as your data model (instead of an array) and gain the ability to easily organize data into sections and simplify your view controller with APIs like `[dataModel numberOfRowsInSection:]`, `[dataModel itemAtIndexPath:]`, and `[dataModel indexPathForItem:]`. Or keep reading to learn about automatic batch updates, easier Core Data integration and more.

##Installation
## Installation

Add "TLIndexPathTools" to your podfile or, if you're not using CocoaPods:

Expand All @@ -21,7 +21,7 @@ Add "TLIndexPathTools" to your podfile or, if you're not using CocoaPods:

<!--CoreData is required for Core Data integration and because `TLIndexPathSectionInfo` implements the `NSFetchedResultsSectionInfo` protocol. QuartzCore is required because the Grid extension uses it.-->

##Overview
## Overview

`NSArray` is the standard construct for simple table and collection view data models. However, if multiple sections are involved, the typical setup is an `NSArray` containing section names and an `NSDictionary` of `NSArrays` containing data items, keyed by section name. Since table and collection views work with `NSIndexPaths`, the following pattern is used repeatedly in data source and delegate methods:

Expand All @@ -43,7 +43,7 @@ Most of the functionality in TLIndexPathTools can be accomplished with just `TLI

This version of TLIndexPathTools is designed to handle up to a few thousand items. Larger data sets may have performance issues.

###TLIndexPathDataModel
### TLIndexPathDataModel

`TLIndexPathDataModel` is an immutable object you use in your view controller to hold your data items instead of an array (or dictionary of arrays, for multiple sections). There are four initializers, a basic one and three for handling multiple sections:

Expand Down Expand Up @@ -91,7 +91,7 @@ dataModel.sections;

As an immutable object, all of the properties and methods in `TLIndexPathDataModel` are read-only. So using the data model is very straightforward once you've selected the appropriate initializer.

###TLIndexPathUpdates
### TLIndexPathUpdates

`TLIndexPathUpdates` is a companion class to `TLIndexPathDataModel` for batch updates. You provide two versions of your data model to the initializer and the inserts, deletes, and moves are calculated. Then call either `performBatchUpdatesOnTableView:` or `performBatchUpdatesOnCollectionView:` to perform the updates.

Expand All @@ -113,7 +113,7 @@ TLIndexPathUpdates *updates = [[TLIndexPathUpdates alloc] initWithOldDataModel:o
Thats all it takes!
###TLIndexPathController
### TLIndexPathController
`TLIndexPathController` is TLIndexPathTools' version of `NSFetchedResultsController`. It should not come as a surprise, then, that you must use this class if you want to integrate with Core Data.
Expand Down Expand Up @@ -199,7 +199,7 @@ The `willUpdateDataModel` delegate method is a really cool feature of `TLIndexPa
}
```

###TLTableViewController & TLCollectionViewController
### TLTableViewController & TLCollectionViewController

`TLTableViewController` and `TLCollectionViewController` are table and collection view base classes that use `TLIndexPathController` and implement the essential data source and delegate methods to get you up and running quickly. Both classes look much like the code outlined above for integrating with `TLIndexPathController`.

Expand All @@ -209,7 +209,7 @@ Both classes support view controller-backed cells. Enabling this feature is as e

Most of the sample projects are based on `TLTableViewController` or `TLCollectionViewController`, so a brief perusal will give you a good idea what can be accomplished with a few lines of code.

##Documentation
## Documentation

The Xcode docset can be generated by running the Docset project. The build configuration assumes [Appledoc][6] is installed at /usr/local/bin/appledoc. This can be changed at TLIndexPathTools project | Docset target | Build Phases tab | Run Script.

Expand Down

0 comments on commit ca47649

Please sign in to comment.