iOS Drag-and-Drop Alignment Guides [closed]
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this questionI'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?
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.
精彩评论