Halpo
Halpo

Reputation: 3134

How can I present a UIMenu from a UITapGestureRecognizer

I want to display a menu from a tap gesture on a UIView. How can I achieve this?

let privacyTap = UITapGestureRecognizer(target: self, action: #selector(self.editVisibilityPressed(sender:)))
metaInfoStack.addGestureRecognizer(privacyTap)

...

@objc func editVisibilityPressed(sender: UIGestureRecognizer) {
    let view = sender.view
    let menu = UIMenu()
        ....
}

Upvotes: 0

Views: 185

Answers (0)

Related Questions