Problem
In my iPad app, I cannot attach a popover to a button bar item only after press-and-hold events. But this seems to be standard for
@utopians answer in Swift 4.2
@objc func myAction(_ sender: UIBarButtonItem, forEvent event:UIEvent) { let longPressed:Bool = (event.allTouches?.first?.tapCount).map {$0 == 0} ?? false ... handle long press ... }