title: To Subclass or not to Subclass, UITabBarController
body: <p>So, like many people I am coming up against UITabBarController, it's <em>not intended for subclassing</em> and <em>must be the root view controller</em> peculiarities.</p>
  
  <p>I have to manage the behavior of all the subviews and the natural way to do it seems to have a root view controller which they report to and which relays messages between them. In my current setup I have PBModalRootViewController which instantiates a UITabBarController and sets it as a subview. The PBModalRootViewController manages the subviews and is responsible for dismissing the modal view.
  <a href="http://p.twimg.com/Abu0iWDCMAAwhuy.jpg:large" rel="nofollow noreferrer">like so http://p.twimg.com/Abu0iWDCMAAwhuy.jpg:large</a></p>
  
  <p>This is a pretty clean solution <strong>but</strong> it leads to dodgy behavior from the UITabBarController which I assume does not like being a subview. This is something I need to fix before I ship and I have a few solutions:</p>
  
  <ol>
  <li><p>Subclass UITabBarController and deal with the potential repercussions later on.</p></li>
  <li><p>Rejig the PBModalRootViewController to be a PBModalSupervisor. i.e.: make it a class that initiates the tabBarController and the subviews, returns a nice configured view and then keeps an eye on all of them for me.<br>
  This could lead to a lot of messing around and extra pointers lying around which might be a pain to manage.</p></li>
  <li><p>Simply redesign the architecture in some ingenious way which would be great, any ideas...</p></li>
  <li><p>All the stuff I haven't thought of...</p></li>
  <li><p>I'm doing it all wrong and need to be slapped with a trout! </p></li>
  <li><p>Use NSNotificationCentre, might this get a bit messy with save, dismiss etc, still need somewhere to manage the dismissal logic.</p></li>
  <li><p>Category on UITabBarController? That would be a way around the subclassing I suppose..</p></li>
  </ol>