Hassan Taleb
Hassan Taleb

Reputation: 2526

Trigger UIMenu item programmatically

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

Upvotes: 0

Views: 352

Answers (1)

benc
benc

Reputation: 2051

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

Upvotes: 0

Related Questions