You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ TLIndexPathTools is a small set of classes that can greatly simplify your table
11
11
12
12
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.
13
13
14
-
##Installation
14
+
##Installation
15
15
16
16
Add "TLIndexPathTools" to your podfile or, if you're not using CocoaPods:
17
17
@@ -21,7 +21,7 @@ Add "TLIndexPathTools" to your podfile or, if you're not using CocoaPods:
21
21
22
22
<!--CoreData is required for Core Data integration and because `TLIndexPathSectionInfo` implements the `NSFetchedResultsSectionInfo` protocol. QuartzCore is required because the Grid extension uses it.-->
23
23
24
-
##Overview
24
+
##Overview
25
25
26
26
`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:
27
27
@@ -43,7 +43,7 @@ Most of the functionality in TLIndexPathTools can be accomplished with just `TLI
43
43
44
44
This version of TLIndexPathTools is designed to handle up to a few thousand items. Larger data sets may have performance issues.
45
45
46
-
###TLIndexPathDataModel
46
+
###TLIndexPathDataModel
47
47
48
48
`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:
49
49
@@ -91,7 +91,7 @@ dataModel.sections;
91
91
92
92
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.
93
93
94
-
###TLIndexPathUpdates
94
+
###TLIndexPathUpdates
95
95
96
96
`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.
`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.
119
119
@@ -199,7 +199,7 @@ The `willUpdateDataModel` delegate method is a really cool feature of `TLIndexPa
`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`.
205
205
@@ -209,7 +209,7 @@ Both classes support view controller-backed cells. Enabling this feature is as e
209
209
210
210
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.
211
211
212
-
##Documentation
212
+
##Documentation
213
213
214
214
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.
0 commit comments