Iglistkit: IGListSingleSectionControllerDelegate selection function should include object

Created on 9 Jan 2017  路  1Comment  路  Source: Instagram/IGListKit

Right now to get the object from the selectionDelegate, you have to:

func didSelect(_ sectionController: IGListSingleSectionController) {
  let object = adapter.object(for: sectionController)
  // do something
}

When IGListSingleSectionController already has the object, this lookup is wasteful.

I propose we change the delegate method to:

- (void)didSelectSingleSectionController:(IGListSingleSectionController *)sectionController 
  withObject:(id)object;
  • What do you think about the naming? "withObject" or maybe just "object"?
  • Should we shorten the method to just didSelectSectionController?
enhancement starter-task

Most helpful comment

For the Swift interop it would be nice for something like didSelect(_ sectionController: .. with object: ..)

If no one else takes it, I may give this a try?

reminder

>All comments

For the Swift interop it would be nice for something like didSelect(_ sectionController: .. with object: ..)

If no one else takes it, I may give this a try?

reminder

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Przemyslaw-Wosko picture Przemyslaw-Wosko  路  3Comments

FazeelAkhtar picture FazeelAkhtar  路  3Comments

HarshilShah picture HarshilShah  路  3Comments

rnystrom picture rnystrom  路  3Comments

krysztalzg picture krysztalzg  路  3Comments