title: Creating a UITabBar With a Normal UIViewController(Not UITabBarController)
body: <p>I have a UIViewController and I wish to place a simple UITabBar like the in the screenshot below: I don't want to use an UITabBarController. In fact, my original setup uses one, and it's easy as cake to get it to work.</p>
  
  <p>However, the thing is I found out it's a bad idea to put UITabBarControllers inside Navigation Controllers, so I'm forced to refactor the hierarchy (so please don't suggest using one).</p>
  
  <p>Given an UIViewController, how can I add an UITabBar on the bottom programatically? I got my UITabBarDelegate all setup to show a specific view when 1 of the tab bars is clicked, but the problem is when the view controller loads, no tab bar shows up! Here's my code to do that:</p>
  
  <pre><code>- (void) viewDidLoad {
          ...some initialization...
      CGRect frame = CGRectMake(0, 431, 320, 49);
  
  
      profileItem = [[UITabBarItem alloc] init];
      profileItem.image = icon;
      profileItem.title = @"Diet";    
  
      tabBar = [[UITabBar alloc] initWithFrame:frame];
      NSArray* items = [[NSArray alloc] initWithObjects:profileItem, nil];
  
      tabBar.items = items;
      tabBar.delegate = self;
      [tabBar setSelectedItem:[tabBar.items objectAtIndex:0]];
  
      [self.view addSubview:tabBar];
      [super viewDidLoad];
  }
  </code></pre>
  
  <p>What am I missing here?</p>
  
  <p><img src="https://i.stack.imgur.com/bnMqV.png" alt="enter image description here"></p>
  
  <p><strong>EDIT</strong>: Argh, I found out it has to do with the frame... Hmm.. what y-coordinate should I use if I have an existing navigation header on top?  </p>