Show UIMenuController from UIBarButtonItem
<p>I have a navigation bar with a bar button item on the right. I would like to open a popup menu when pressing that button.</p>

<p>Can anyone tell why this doesn't work:</p>

<pre><code>@IBAction func quickJumpClicked() {

    let menu = UIMenuController.sharedMenuController()
    menu.menuItems =
        [UIMenuItem(title: "Test me", action: Selector("deleteLine")),
        UIMenuItem(title: "Test me", action: Selector("deleteLine")),
        UIMenuItem(title: "Test me", action: Selector("deleteLine"))]
    menu.setTargetRect(self.navigationController!.toolbar.subviews[1].frame, inView: self.view.superview!)

    becomeFirstResponder()
    menu.setMenuVisible(true, animated: true)
}
</code></pre>