I'm trying to get some advice on how to go about implementing the same sort of "drag to reorder" behavior found on a
but on a
So far this is what I'm thinking:
- Add a long press gesture recognizer to each of the
- On long press, add an overlay
as a subview to the main view and that fills the entire main view. This overlay view will act as a "canvas" of sorts as I'm dragging the temporary "reorder" view—we'll call this the
— around (more on that in 4)
- Set the
to 0 (setting
would result in the
hidden = true
animating closing in as if it were removed.
- Add a
to the overlay view (see 3) with the same initial frame as the
- Drag the
up or down and insert/remove the actual
at a calculated index based on the position of the
- Listen for when the long press
and set the
and remove the overlay view from the main view.
arrangedSubview.alpha = 1
Any suggestions? Any glaring holes that anyone sees? What would you change? What direction would you go to accomplish this?