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

Move to using NSIndexPaths in delegate methods #40

Closed
SteveFortune opened this issue Nov 29, 2014 · 0 comments
Closed

Move to using NSIndexPaths in delegate methods #40

SteveFortune opened this issue Nov 29, 2014 · 0 comments

Comments

@SteveFortune
Copy link
Member

NSIndexPath is a much cleaner* way of providing the metadata around the items that are being drag / dropped. If we are drag/dropping between UI[Collection | Table]Views, at the moment users have to implement boilerplate code to map a given point to an index path in the drag data source. It makes sense to do the following:

  • Add indexPathForItemAtPoint to I3Collection
  • Change itemAtPoint to itemAtIndexPath in I3Collection
  • Delegate the responsibility of mapping index paths to actual item views, out to the collection implementation
  • Document and provide use cases for how users might implement an NSIndexPath category for use with their own I3Collection implementations. For example, a UIView that implements I3Collection may extend NSIndexPath to provide metadata about the position of its subviews.

Refactor the coordinator and other related classes to deal only in NSIndexPaths. Now we can adequately encapsulate the responsibility of mapping a given point to an associated data index to the collection.

*its cleaner in my opinion, because CGPoints are meant to specify exactly where the item is on the screen. NSIndexPath provides data about 'which items belong where' in a more abstract data-oriented way

SteveFortune added a commit that referenced this issue Nov 29, 2014
SteveFortune added a commit that referenced this issue Nov 29, 2014
SteveFortune added a commit that referenced this issue Nov 29, 2014
… points and added a load of notes to the collectoin protocol.
SteveFortune added a commit that referenced this issue Dec 2, 2014
SteveFortune added a commit that referenced this issue Dec 11, 2014
SteveFortune added a commit that referenced this issue Dec 11, 2014
…educe a lot of the boilerplate in mocking and stubbing collection instances with this class
SteveFortune added a commit that referenced this issue Dec 11, 2014
…we can reduce a lot of the boilerplate in mocking and stubbing collection instances with this class"

This reverts commit ddc6a92.
SteveFortune added a commit that referenced this issue Dec 11, 2014
…cally - going to split the coordinator tests into separate files
SteveFortune added a commit that referenced this issue Dec 16, 2014
…le of isue with the collection fixtures ctor
SteveFortune added a commit that referenced this issue Dec 16, 2014
…cated fixtures and creation methods. To date, the coordiantor tests have just been difficult to deal with; there has been so much redundant fixtures setup code that they have ended up obscure and fragile. We are now moving all the complex SUT and fixture setup code to creation methods and are splitting the coordinator tests up into separate files to make them more readable.
SteveFortune added a commit that referenced this issue Dec 16, 2014
…dancy and passed current 'successul drag start' tests
SteveFortune added a commit that referenced this issue Dec 16, 2014
…nd readable, also much clearer what behaviour of the SUT is being verified
SteveFortune added a commit that referenced this issue Dec 16, 2014
SteveFortune added a commit that referenced this issue Dec 16, 2014
SteveFortune added a commit that referenced this issue Dec 16, 2014
…ribe blocks for different interactions (deletion, rearrange, exchange, etc)
SteveFortune added a commit that referenced this issue Dec 17, 2014
SteveFortune added a commit that referenced this issue Dec 17, 2014
… Removed problematic UIImage comparison in clone view test - note that this comparison did not hold true on 64 bit devices
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