A really handy class that automatically figures out insertions, deletions, and reloads in UITableView based on unique item keys.
Objective-C
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
CueTableReloader.xcodeproj
CueTableReloader
CueTableReloaderDemo
CueTableReloaderTests
AUTHORS
LICENSE
README.md

README.md

CueTableReloader

A really handy class that automatically figures out insertions, deletions, moves, and reloads in UITableView based on unique item keys.

#Usage

  1. Ensure that your data model consists of a two level array: [sections][rows].
  2. Implement the CueTableItem protocol on all of your data objects and ensure that all of your keys are 100% unique.
  3. Replace all reloadData calls with calls to CueTableReloader's reloadData:animated:.
CueTableReloader *reloader = [[CueTableReloader alloc] initWithTableView:tableView];

/* ... */

// Replace all calls to [tableView reloadData] with this.
[reloader reloadData:sections animated:YES];

#Limitations This class works very well for insertions and deletions within the same section. It does its best when existing items reorder relative to each other. Any travel from one section to another is treated as a delete+insert.

####Known Bugs

  • Some complex transitions involving reordering can cause a non-animated reload. Pull requests welcome.

License

Apache License version 2.0

Authors

Cue

Created as part of Back On The Map.