How to set UITableView DataSet


IOS Programming

The Empty DataSet Pattern

Most applications display lists of content (datasets), which many turn out to be empty at one point, specially for new users with blank accounts. Empty screens create confusion by not being clear about what’s going on, if there is an error/bug or if the user is supposed to do something within your app to be able to consume the content.

Empty Datasets are helpful for:

  • Avoiding white-screens and communicating to your users why the screen is empty.
  • Calling to action (particularly as a boarding process for your new users).
  • Avoiding other interruptive mechanisms like showing error alerts.
  • Beeing consistent and improving the user experience.
  • Delivering a brand presence.


  • Uses KVO to observe whenever the tableview calls -reloadData.
  • Gives multiple possibilities of layout and appearance, by showing an image and/or title label and/or description label and/or button.
  • Uses NSAttributedString for easier appearance customisation.
  • Uses auto-layout to automagically center the content to the tableview, with auto-rotation support.
  • Allows tap gesture on the whole tableview bounds (useful for resigning first responder or similar actions).
  • Background color customisation.
  • iPhone (3.5″ & 4″) and iPad support. iOS7 compatible only.
  • ARC & 64bits support.

This library has been designed in a way where you won’t need to use an extended UITableView class. It will still work when using UITableViewController. By simply conforming to the datasource and delegate you will be able to fully customize the content and appearance of the empty datasets for your application.

Leave a Reply

Your email address will not be published. Required fields are marked *