Re: How to accept drag of a URL on the dock icon?
Re: How to accept drag of a URL on the dock icon?
- Subject: Re: How to accept drag of a URL on the dock icon?
- From: Andy Lee <email@hidden>
- Date: Sat, 21 Dec 2013 18:22:07 -0500
To answer my own question, it looks like it's done by implementing a Service. I've gotten it working in a quick scratch application.
--Andy
On Dec 21, 2013, at 6:06 PM, Andy Lee <email@hidden> wrote:
> I know how to accept files that are dragged from Finder to the application icon. It's a matter of adding some settings to Info.plist and implementing the application:openFiles: application delegate method.
>
> This does not work for dragging URLs from a web browser -- for example, dragging from Safari's URL field, or dragging an image being displayed in Safari to the dock icon. What happens is, my application:openFiles: method is never called, and the URL is given back to Safari to reload.
>
> Yet it is clearly possible for applications to accept dragging of URLs to their Dock icons, because it works for other browsers. What are those other browsers doing?
>
> I tried using a custom contentView for the dock tile, and having that view be a drag destination (call registerForDraggedTypes: and implement NSDraggingDestination methods). But that didn't make any difference.
>
> --Andy
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden