iPhone: Touch, Drag, Hit!

May 1, 2009 | Filed Under Mac OS X, iPhone | 3 Comments

Yesterday, Fredrik has asked me something like “Drag & Drop with Hit Test” on the iPhone. Here’s a simple example.  There’s a simple UIView class that handles the touch events and a protocol that says that if the “DragMe View” has hit or not the “HitMe View”. Below you can see the result and the Source Code Link.

iPhone Touch Drag Hit

The source code is available here: Touch, Drag, Hit Source Code.

Cocoa: Drag & Drop

February 28, 2009 | Filed Under Cocoa | 1 Comment

Today a simple example of Drag & Drop with Cocoa and NSView. The screenshot below shows two groups. In the first one, you can drop the photos on your filesystem, taken from Desktop or Finder. In the second group, you can only drop the first group image.

Cocoa Drag & Drop Test App

You can find the source code here: Drag & Drop Test Source Code.