views:

107

answers:

1

I'm looking to develop an iOS app that includes drag and droppable interface elements, but with alignment guides like those in Keynote or OmniGraffle or Interface Builder (the yellow lines in Keynote) such that when you drag something near enough to vertical or horizontal alignment with another object in the canvas, it displays a guide line and automatically snaps into to alignment.

So far, I haven't been able to find any published API to implement this. Does such a thing exist anywhere? It's a little bit difficult of a concept to Google successfully. If not, any pointers on rolling my own with a minimum of pain? Thanks!

+1  A: 

There is no standard API provided by iOS. You have to implement it yourself.

This isn't exactly what you want, but I threw together a little sample app that lets you drag icons around the screen that snap into place like on the iPhone home screen: Tiles. It doesn't draw any guide lines, so you'll have to figure that out yourself.

Kristopher Johnson