nicklockwood / iCarousel

A simple, highly customisable, data-driven 3D carousel for iOS and Mac OS
http://www.charcoaldesign.co.uk/source/cocoa#icarousel
Other
12k stars 2.58k forks source link

carouselCurrentItemIndexDidChange on Add/Delete #807

Open AlexHedley opened 7 years ago

AlexHedley commented 7 years ago

Should carouselCurrentItemIndexDidChange be called when you Add/Delete an item?

I've got a supplementary view that is displaying information about the currently selected item When you scroll this updates.

If I delete an item this method isn't called.

[self didScroll]; is being called but then _previousItemIndex equals currentItemIndex so the delegate is never called.

if (_previousItemIndex != self.currentItemIndex)
{
    [self pushAnimationState:YES];
    [_delegate carouselCurrentItemIndexDidChange:self];
    [self popAnimationState];
}