简体   繁体   中英

How to show the menu of UIButton().menu only when long pressed in iOS?

By setting UIButton().menu, a menu can be shown when tapped.

And a menu is shown when long pressed, too.

I want to execute some another action (for example, change text) when tapped, and show a menu when long pressed.

How to show a menu only when long pressed, like Safari's show tabs button on the right bottom of the screen?

In Safari, tabs are shown when show tabs button is tapped, and a menu is shown when show tabs button is long pressed.

btn.showsMenuAsPrimaryAction = false

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM