title: UIPopoverPresentationController not working for bar button item
body: <p>I am trying to create a small menu that drops down from the right bar button on one of my view controllers. However, it won't properly present as a popover. Every time I try something new it keeps presenting the menu as a regular view controller with the regular modal style for iOS 13.</p>
  
  <p>I have tried a lot of different changes, but always seem to get the same result.</p>
  
  <pre><code>func setupNav() {
      let menuButton = UIButton()
      menuButton.setImage(UIImage(named: "menu")?.withRenderingMode(.alwaysTemplate), for: .normal)
      menuButton.sizeToFit()
      menuButton.addTarget(self, action: #selector(handleMenuTap(_:)), for: .touchUpInside)
      navigationItem.rightBarButtonItem = UIBarButtonItem(customView: menuButton)
  }
  
  @objc func handleMenuTap(_ sender: UIButton) {
      let menuVC = UploadMenuViewController()
      menuVC.modalPresentationStyle = .popover
  
      if let menu = menuVC.popoverPresentationController {
          menu.barButtonItem = navigationItem.rightBarButtonItem
          menu.delegate = self
          present(menuVC, animated: true, completion: nil)
      }
  }
  </code></pre>
  
  <p>View Controller for the menu</p>
  
  <pre><code>class UploadMenuViewController: UIViewController {
  
      override func viewDidLoad() {
          super.viewDidLoad()
          self.preferredContentSize = CGSize(width: 200, height: 300)
          self.view.backgroundColor = .red
      }
  
  }
  </code></pre>