Re: iOS: selectable but not editable text
Gerriet M. Denkmann
On 12 Apr 2022, at 15:23, Jens Alfke <jens@...> wrote:So first I enabled isUserInteractionEnabled for my UILabel.On Apr 9, 2022, at 11:59 PM, Gerriet M. Denkmann <gerriet@...> wrote:On iOS the idiomatic way to do this is not selecting the text, but a long-press gesture that brings up a context menu with a Copy item.
Then, In viewDidLoad() I added:
let interaction = UIContextMenuInteraction(delegate: self)
Long-press on my UILabel works fine on iPhone and iPad. Somehow idiomatic. What I really expected: double click on my label (or long-press) and get a standard menu on top with: Copy, Look Up, Translate, etc.
And on Mac (using Catalyst): a control-click also gets my context menu.
Thanks for your suggestions!