Skip to content

Instantly share code, notes, and snippets.

@saikat
Created May 12, 2009 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saikat/110635 to your computer and use it in GitHub Desktop.
Save saikat/110635 to your computer and use it in GitHub Desktop.
- (void)performDragOperation:(CPDraggingInfo)aSender
{
var data = [[aSender draggingPasteboard] dataForType:WidgetDragType];
var widget = [CPKeyedUnarchiver unarchiveObjectWithData:data];
var dropLocationX = [aSender draggedViewLocation].x - [[aSender draggingSource] frame].size.width;
var dropLocationY = [aSender draggedViewLocation].y - [[aSender draggedView] frame].size.height;
[widget setFrameOrigin:CGPointMake (dropLocationX, dropLocationY)];
[self addSubview:widget];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment