title: Unable to see controller added to UITabBar programmatically swift
body: <p>I added 2 tabBar items from storyboard and one UITabBarItem - <em>Menu</em> programmatically. I am successfully able to open the controllers corresponding to tabBarItems which I created using storyboard. However, when I click on "Menu" a blank black screen appears, </p>
  
  <pre><code>@objc public class MainScreenTabsController : UITabBarController {
  public override func viewDidLoad() {
      super.viewDidLoad()
      let tabController = MyViewController()
      let tabBarItem = UITabBarItem(title: "Menu", image: UIImage(named: "more-options.png"), selectedImage: UIImage(named: "more-options"))
      tabController.tabBarItem = tabBarItem
      var array = self.viewControllers
      array?.append(tabController)
      self.viewControllers = array
  }
  
  public func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -&gt; Bool {
      return true;
  }
  
  public override func viewWillAppear(_ animated: Bool) {
      super.viewWillAppear(animated)
  }
  }
  </code></pre>
  
  <p>I followed couple of tutorials for adding tab bar item but all of them had the code I wrote. Am I missing out something very basic?
  <a href="https://i.stack.imgur.com/YMrTa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YMrTa.png" alt="The three dots represent menu. The word menu is not included because in the real code I gave a blank string"></a></p>
  
  <p>EDIT:</p>
  
  <p>Class for Menu Controller</p>
  
  <pre><code>@objc public class MyViewController:UIViewController {
  
  public override func viewDidLoad() {
      super.viewDidLoad()
  }
  
  public override func viewWillAppear(_ animated: Bool) {
      super.viewWillAppear(animated)
  }
  }
  </code></pre>