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.
CodePudding user response:
btn.showsMenuAsPrimaryAction = false