views:

228

answers:

2

Hi guys

I'm very interested in using the typical mac 'tag' element in an iphone app (see specimen 1 - The Blue round element'). I dont really have any idea of how to implement it except for copying the color and making it a uibutton. I would like to be able to drag this tag from one 'section' to another 'section'.

Can someone point me in the right direction of how this would be done. Surely a simple library is available somewhere.

Keep it classy stackoverflow.

alt text

+1  A: 

Simply create a new class that is a subclass of UIView and add the subviews in the initWithFrame: method. Then implement the touch handling methods that you need to create your custom view with dragging behavior.

Squeegy
+3  A: 

This control is called an NSTokenField in Cocoa AppKit. You can find something similar to start with in the three20 project. The control is called a TTPickerTextField I believe. You could use that as a basis for your control and add the drag and drop capabilities using the UIResponder methods touchesBegan/Moved/Ended.

bstahlhood