It would be great to have an example that shows how to use the displayDelegate. This would be particularly useful for (like in Instagram) playing and stopping videos within cells.
I also noticed you have to implement both -listAdapter:willDisplaySectionController:and -listAdapter:willDisplaySectionController:cell:atIndex: (and the same for didEndDisplaying). Both versions of the functions get called at the same time. What's the reasoning behind that?
Thanks @yusuftor ! 馃槃
Agreed, we should add an example. Even if it just logs the method calls.
@rnystrom -- This is a good point. Do we need *displaySectionController: and *displaySectionController: cell: ?
Oh nevermind.
@yusuftor
*displaySectionController: -- these methods provide _section_-level notifications*displaySectionController: cell: -- these methods provide _item_-level notificationsWe should probably make the docs more clear about this.
The first one is only sent when the section controller starts becoming visible (first cell) and the second method is called for each cell that is displayed. Gives you options to do work when the section controller is going to be displayed in general vs doing something for specific cells.
They can be useful for things like impression logging when the section controller becomes visible, then like playing the video when the video cell becomes visible.
But +1 on the display delegate example. I've got a queue of examples to get up! All very useful though.
Ahh yes, that makes sense! Thanks.
@rnystrom @jessesquires Shall we add an @optional directive to this protocol?
@zhubofei I also think it would be good to go through all the protocols and add @optional to all methods that aren't required, would save a lot of space taken up by blank functions! However, this has already been mentioned in #62.
Ya we have a pretty firm anti-@optional stance here in favor of the compiler catching our bugs for us.
Most helpful comment
Ya we have a pretty firm anti-
@optionalstance here in favor of the compiler catching our bugs for us.