Twitter | Search | |
Michael Tsai 18 Oct 18
Replying to @weichsel
How does your example work? I don’t see any linkage between your requestor object and the menu.
Reply Retweet Like
Thomas Zoechling 18 Oct 18
Replying to @mjtsai
The Continuity stuff seems to store the requestor that it receives from validRequestor(::) to later call readSelection(:) on it. (In the implementation of the menu item's action).
Reply Retweet Like
Michael Tsai 18 Oct 18
Replying to @weichsel
It doesn’t seem like it could just be that the menu is summoned from an action on a object that is a valid requestor because that would lead to adding the menu items in inappropriate places…
Reply Retweet Like
Thomas Zoechling 18 Oct 18
Replying to @mjtsai
Good point. I just added a second menu and set it as context menu of my root view. It also got populated. Only way to opt-out from getting that menu inserted seems to be to return super.validRequestor(::) in your own implementation.
Reply Retweet Like
Michael Tsai 18 Oct 18
Replying to @weichsel
This seems so bizarre. What if you’re implementing validRequestor because you want to receive images from services, but you don’t want the current menu to be changed?
Reply Retweet Like
Thomas Zoechling 18 Oct 18
Replying to @mjtsai
True. I assume the NSMenuItemImportFromDeviceIdentifier you discovered could be used to control that behavior somehow. But I haven't figured out how yet. Some official docs would be really helpful here.
Reply Retweet Like
Michael Tsai 18 Oct 18
Replying to @weichsel
I was able to get a NSMenuItemImportFromDeviceIdentifier menu item (in the menu bar) replaced by the submenu. Looks like the reason it wasn’t working before is the I was adding the menu item after launch. Adding it earlier, in awakeFromNib, helped.
Reply Retweet Like
Thomas Zoechling 18 Oct 18
Replying to @mjtsai
Can confirm that. Tried it with a menu bar item and set the identifier in IB. But still no luck with context menus.
Reply Retweet Like
Michael Tsai 18 Oct 18
Replying to @weichsel
I’m seeing strange results with a menu bar item, though. For example, it’s sometimes calling readSelectionFromPasteboard() on the first responder even though that was not the validRequestor I returned.
Reply Retweet Like
Thomas Zoechling 18 Oct 18
Replying to @mjtsai
Same here. I think I will file some Radars tomorrow.
Reply Retweet Like
🆆il 🆂hipley, his arms wide
Apple really screwed up with the API (or total lack thereof) of the continuity camera. It is really, really poor.
Reply Retweet Like More
Thomas Zoechling Sep 21
Replying to @wilshipley @mjtsai
Yes, the API is strange. But at least there is now a nice official doc that explains how to use it: The article also mentions that placement of the CC item can be controlled in the main menu but not in contextual menus. It doesn't explain why, though😐.
Reply Retweet Like
🆆il 🆂hipley, his arms wide Sep 21
Replying to @weichsel @mjtsai
It’s just completely bizarre that they didn’t let us access the service directly, and instead insist on magically sticking it only in menus. Why can’t we trigger, say, JUST scanning a document, and with a button?
Reply Retweet Like