title: How to present popover from tab bar item?
body: <p>I want to present a <code>ViewController</code> as popover in Swift 4, but it presents the <code>Viewcontroller</code> normally, this is the code:</p>
  
  <pre><code>class CustomTabBarController: UITabBarController {
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          let favViewController = TrialViewController()
          let exhibtionViewController = TrialViewController()
          let menuViewController = ttttViewController()
          let notificationViewController = TrialViewController()
          let profileViewController = ttttViewController()
  
          favViewController.tabBarItem.title = "first"
          exhibtionViewController.tabBarItem.title = "second"
          menuViewController.tabBarItem.title = "third"
          notificationViewController.tabBarItem.title = "forth"
          profileViewController.tabBarItem.title = "fifth"
  
          favViewController.tabBarItem.image = UIImage(named:"home25")
          exhibtionViewController.tabBarItem.image = UIImage(named: "bag25")
          menuViewController.tabBarItem.image = UIImage(named: "main_add_25")
          notificationViewController.tabBarItem.image = UIImage(named: "notification25")
          profileViewController.tabBarItem.image = UIImage(named: "man_man25")
  
  
          let tabBarItemWidth = Int(self.tabBar.frame.size.width) / (self.tabBar.items?.count)!
          let x = tabBarItemWidth * 3;
          let newRect = CGRect(x: x, y: 0, width: tabBarItemWidth, height: Int(self.tabBar.frame.size.height))
          print(newRect)
  
          menuViewController.modalPresentationStyle = .popover
          menuViewController.view.frame = newRect
          menuViewController.preferredContentSize = CGSize(width: 150,height: 150)
  
          if let popoverMenuViewController = menuViewController.popoverPresentationController {
              popoverMenuViewController.permittedArrowDirections = .down
              popoverMenuViewController.delegate = menuViewController as? UIPopoverPresentationControllerDelegate
              popoverMenuViewController.sourceRect = newRect
              popoverMenuViewController.sourceView = self.tabBar
  
              present(menuViewController, animated: true, completion: nil)
  
          }
  
          viewControllers = [favViewController, exhibtionViewController, menuViewController, notificationViewController, profileViewController]
      }
  
  }
  </code></pre>
  
  <p>what is the problem with my code?</p>