Gk browser drag reorder array

Possible to drag array items to reorder. Animated.

Requires change in bindings

https://app.asana.com/0/15028213105325/13316669162245
Yes, that's how i understand the move function, and that's why i implemented the bindings for the two array types that way.

On 11 sep 2014, at 20:29, "astigsen" <notifications@github.com<mailto:notifications@github.com>> wrote:


In Realm/RLMArray.h:

> @@ -176,6 +176,19 @@
>   */
>  - (void)replaceObjectAtIndex:(NSUInteger)index withObject:(RLMObject *)anObject;
>
> +/**
> + Moves an object at from a given index to another given index.
> +
> + Throws an exception when called with a source index greater than or equal to,
> + or a destination index greater than, the number of objects in this RLMArray
> +
> + @warning This method can only be called during a write transaction.
> +
> + @param fromIndex   The array index of the object to move.
> + @param toIndex     The array index of the position in the original array to move the object to.


If this matches the semantics of the move() method in core, then Gustafs text is actually correct. You don't want to specify the move with the final position, as that is likely to be influenced be the move itself (if you move the object from a position above the target position, it will be affected by the fact that the object will be removed above it). Since it is adjust differently based on which positions you move from/to the final position is not really usable as a stable input.

—
Reply to this email directly or view it on GitHub<https://github.com/realm/realm-cocoa/pull/894/files#r17438888>.