IGListKit icon indicating copy to clipboard operation
IGListKit copied to clipboard

WatchOS support for Diffing

Open jlaws opened this issue 7 years ago • 8 comments

It would be great to have the Diffing subspec for WatchOS, is there a reason why it's restricted to iOS/TVOS/MacOS currently?

jlaws avatar Jan 17 '18 17:01 jlaws

Great question! The diffing part should easily be usable in watchOS. Is our CocoaPods setup now restricting that? If so, I’d instantly accept a PR to change that.

Sent with GitHawk

rnystrom avatar Jan 17 '18 17:01 rnystrom

IIRC the issue was when I looked at this previously that the diffing code has pretty strong references to an IndexSet which is currently not in watchOS

This may be wrong though so definitely worth a check!

Sherlouk avatar Jan 17 '18 18:01 Sherlouk

Just checked. Indeed, it looks like the issue lies with the property `section' of NSIndexPath being defined in UITableView.h of UIKit.

ajkolean avatar Jan 17 '18 18:01 ajkolean

Sounds like NSIndexPath/IndexPath need to be abstracted behind a protocol so that WatchOS can have its own implementation. Would a change like that work for a PR?

jlaws avatar Jan 17 '18 18:01 jlaws

NSIndexPath is available in watchOS, just not the UIKit extensions (section, row, item). We should be able to easily use the basic version of NSIndexPath (using actual index paths to represent section/item).

Sent with GitHawk

rnystrom avatar Jan 17 '18 21:01 rnystrom

I wrote this, maybe it's helpful: https://github.com/futuretap/IGListKit/commit/f785f5bde572a65756a8c2ebe138e721d02b6ba5

futuretap avatar Apr 26 '23 08:04 futuretap

@futuretap Oooh! Fantastic! Absolutely! Could you please add that as a PR? šŸŽ‰šŸ™

TimOliver avatar Apr 28 '23 06:04 TimOliver

I'm hesitant since I no longer use IGListKit, so the code isn't tested against HEAD. But feel free to grab it.

futuretap avatar Apr 28 '23 08:04 futuretap