While working on the Mac Catalyst version of my iOS app, I noticed something interesting. I have a UITextView
with the allowsEditingTextAttributes
property enabled. When running the app on a Mac, the context menu that appears when right-clicking inside the UITextField
includes the menu item "Import from iPhone or iPad". That brings up a menu with 3 options each for my iPhone and iPad that I happen to connected to my Mac recently. There options include "Take Photo", "Scan Documents", and "Add Sketch".
I created a brand new iOS app project and simply added a UITextView to the main view controller. After setting allowsEditingTextAttributes
to true
, it shows the same behavior.
Some questions:
-
Is this documented anywhere? I'm guessing this is related to Continuity Camera in some way. But there's no mention of this anywhere that I've seen so far.
-
How can I prevent this menu from appearing? Nothing related to these menus comes through the
canPerformAction(_:withSender:)
method. And nothing related to these menus is part of the menu item array sent to theUITextViewDelegate textView(_:editMenuForTextIn:suggestedActions:)
method. I need to remove this menu in my app because while I support some text attributes (bold, italic, underline), I do not want to allow pictures to be added. -
Does anything else in iOS under Mac Catalyst automatically get similar support? If so, what?