Search code examples
iosuimenucontroller

What is the name of this segment on UIMenuItem?


UIMenuItem

I know that the UIMenuController can show a popover containing Cut, Copy, Paste, Select/All, and other system menu items. But I don't know what the last item is, visible in the screenshot above. What is its function? Does it call anything within the application, and if so, what? Can it be disabled? In this case, I would like to disable or remove the item programmatically, without disabling any international keyboards.


Solution

  • Assuming you are talking about disabling the RTL menu item programmatically without disabling international keyboards, it doesn't appear that you can - at least not while using UIMenuController. If you look at the documentation for its menuItems property, it explains that custom items can be inserted after system items, but makes no indication that you can remove those system items that you for some reason do not want.

    Tapping it might result in iOS calling the UITextInput protocol's setBaseWritingDirection:forRange: method. I don't know about that, though – I can only guess since there's no clear explanation of this that I'm aware of after a short run around the documentation.