1

I am using iCarousel for displaying images in Rotary flow. I am calling this method :

-(void)carouselCurrentItemIndexDidChange:(iCarousel *)carousel 

for changing image during swipe. Now initially when i come to my view controller this method is getting called and it is giving me -1 Current index instead of 0. (and because of this app crash with beyond bounds for empty array). Can anyone help me out!

Niharika
  • 1,188
  • 15
  • 37

1 Answers1

0

try this

Swift 3.0

  func carouselCurrentItemIndexDidChange(_ carousel: iCarousel) {
        print(carousel.currentItemIndex)
  }

ObjectiveC

-(void)carouselCurrentItemIndexDidChange:(iCarousel *)carousel {
       NSLog(@"%d",carousel.currentItemIndex)
}
Harshal Valanda
  • 5,331
  • 26
  • 63