Trigger UIMenu item programmatically

91 Views Asked by At

How can we press a UIMenu item programmatically?

I want to trigger the 'Copy' item programmatically to open its submenu (Simulate the user press). Is there a way to do this? enter image description here

1

There are 1 best solutions below

0
benc On

From looking at the documents, Apple did not provide anything to allow this. The object is no related to UIView or UIControls, so the commonly used behaviors inherited from UIRespodner are not available.

Responder objects — instances of UIResponder — constitute the event-handling backbone of a UIKit app...

https://developer.apple.com/documentation/uikit/uiresponder#overview