Creating a Tabbar

I haven’t seen many examples of creating a tabbar controller other than “theElements” example from Apple, which is pretty intense. So, what follows is a short snippet from a proof-of-concept application I was recently working on.

The basic idea is as follows: a UITabBarController contains an array of UIViewController objects, and these views are swapped when one of the tabbar buttons is clicked. You can see in the code below how I setup the view controllers that will be displayed for each tab, and add those controllers into the tabbar controller array.
Continue reading