Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Exchange' is semantically wrong #43

Closed
SteveFortune opened this issue Dec 19, 2014 · 2 comments
Closed

'Exchange' is semantically wrong #43

SteveFortune opened this issue Dec 19, 2014 · 2 comments

Comments

@SteveFortune
Copy link
Member

The implementation of exchange does not actually ever exchange. It drops.

We need to review 'append' vs 'exchange'.

@SteveFortune SteveFortune changed the title 'Exchange' is syntactically and semantically wrong 'Exchange' is semantically wrong Dec 19, 2014
@SteveFortune
Copy link
Member Author

I propose the follow in replace of 'exchange' and 'append':

  • First, the coordinator checks whether we're dropping on a specific index path, and if so, whether the data source implements [can]dropFrom:(NSIndexPath *)from inCollection:(UIView<I3Collection> *)fromCollection to:(NSIndexPath *)to inCollection(UIView<I3Collection> *)toCollection
    • If it does implement these methods and explicitly allows to drop on the given index path, we drop
    • If it does implement these methods and explicitly disallows to drop on the given index path, we snap back
    • Iff it does not implement these methods, then we check for [can]dropFrom:(NSIndexPath *)from inCollection:(UIView<I3Collection> *)fromCollection toPoint:(CGPoint)to inCollection(UIView<I3Collection> *)toCollection (this replaces append)

@SteveFortune
Copy link
Member Author

To summarise this is the new alg:

  • If data source says delete at this drop origin
    • Delete
  • Else if stop drag on collection && if drag stopped on same collection as origin && valid item at drop origin && data source says rearrangeable
    • Rearrange
  • Else if drag stopped on different collection
    • If data source implements drop on index selectors
      • If data source allows drop on index
        • Drops on index
      • Else
        • Reset
    • Else if data source implements drop on point selectors && can drop on point
      • Drops on point
    • Else
      • Reset
  • Else
    • Reset

SteveFortune added a commit that referenced this issue Dec 19, 2014
Comments out all the broken 'drop' tests and refactored basic render delegate tests. Test not compile
and run.
SteveFortune added a commit that referenced this issue Dec 19, 2014
…sful 'drop on index' cases - also added a test to the unsuccessful rearrange tests for rendering reset
SteveFortune added a commit that referenced this issue Dec 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant