title: How to use a UITabBar without UITabBarController?
body: <p>I want to implement a tab bar in the top of the iPhone screen, and want to be able to navigate in the different views. I have used the delegate method, here is how it looks in the storyboard:</p>
  
  <p><img src="https://i.stack.imgur.com/3sccp.png" alt="Click here to see the screenshot"></p>
  
  <p>However, as I cannot delegate the TabBar to multiple containers, it seems the code that I have implemented doesn't work, here it is:</p>
  
  <pre><code>class PersonnesController: UIViewController, UITabBarDelegate {
  
      @IBOutlet weak var tabBar : UITabBar!
      @IBOutlet weak var comptesContainer : UIView!
      @IBOutlet weak var membreContainer : UIView!
      @IBOutlet weak var discussionContainer : UIView!
  
      override func viewDidLoad() {
          super.viewDidLoad()
          // Do any additional setup after loading the view, typically from a nib.
          tabBar.delegate = self
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  
      func tabBarDelegate(tabBar: UITabBar!, didSelectItem item: UITabBarItem!) {
  
          switch item.tag {
              case 1:
                  comptesContainer.isHidden = false
                  membreContainer.isHidden = true
                  discussionContainer.isHidden = true
  
              case 2:
                  comptesContainer.isHidden = true
                  membreContainer.isHidden = false
                  discussionContainer.isHidden = true
  
              case 3:
                  comptesContainer.isHidden = true
                  membreContainer.isHidden = false
                  discussionContainer.isHidden = true
  
              default:
                  comptesContainer.isHidden = false
                  membreContainer.isHidden = true
                  discussionContainer.isHidden = true
          }
      }
  }
  </code></pre>
  
  <p>The real problem seems to be that I can only delegate the TabBar to only one container without being to delegate to the three. How could I achieve that?</p>
  
  <p>PS : The best response I have found yet is <a href="https://stackoverflow.com/questions/36783074/tab-bar-without-tabbarcontroller-add-view-controller-for-tab-bar-item-in-story">here</a> but I fail to implement it, I don't know how he/she manages to delegate multiple times.</p>