AFAIK, there is no method that returns an image of the current image, but I created a workaround for this ....
array= [NSArray arrayWithObjects:[UIImage imageNamed:@"1.jpg"],[UIImage imageNamed:@"2.jpg"],[UIImage imageNamed:@"3.jpg"],[UIImage imageNamed:@"4.jpg"],[UIImage imageNamed:@"5.jpg"],nil]; mainSlideShowImageView.animationImages= array; mainSlideShowImageView.animationDuration=15.0; i=0; timer = [NSTimer scheduledTimerWithTimeInterval:3.0 target:self selector:@selector(increase) userInfo:nil repeats:YES]; [mainSlideShowImageView startAnimating]; -(void)increase { i++; if (i>4) { i=0; } } -(void)getimage { UIImage* im = [array objectAtIndex:i];
I took 5 images here and the animation duration is 15, which means the image will change every 3 seconds, so I have to hold the timer every 3 seconds ... and since the array contains 5 images ... so if 'i' goes beyond limits 4 I returned it to 0 when increasing the method
source share