Last Updated: February 25, 2016
·
917
· roderic

Custom XCode 4 templates can speed up UITableViewController boilerplate work

There are a lot of great things you can do with a UITableViewController if you're willing to put in the work. For my apps, a lot of this code is common, or at least, similarly structured.

  1. UITableViewDelegate methods
  2. UITableViewDataSource methods
  3. Setting up an NSFetchedResultsController
  4. Setting up NSFetchedResultsControllerDelegate methods to observe changes
  5. Pull to refresh functionality

This all seems like a great opportunity to use XCode Templates.
I stumbled upon Bob MCCunes's blog . Lots of great information about getting started with the template system that Apple has provided. I thought we could take it a bit further so...

Introducing my Common iOS Templates project.

From this, you can get a UITableViewController up and running in just about 3 minutes. A View I made in 3 minutes may not be what the customer ends up seeing, but for native UITableViews where I get to see what's in Core Data has proven to be highly productive.

All of the instructions for setup are in the README. There is nothing crazy happening in the this template, just common stuff I've used.

I'll keep working on this and add stuff as I see fit, for now though, I'm saving tons of time.