A common approach is UIScrollView the size of one of the images, with support for paging.
Add images as subzones and set the content size as follows:
NSArray *images;
CGSize imageSize;
self.scrollView.frame = CGRectMake(10,10,imageSize.width,imageSize.height);
self.scrollView.contentSize = CGSizeMake(imageSize.width * images.count, imageSize.height);
self.scrollView.pagingEnabled = YES;
CGFloat xPos = 0.0;
for (UIImage *image in images) {
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
imageView.frame = CGRectMake(xPos, 0.0, imageSize.width, imageSize.width);
[self.scrollView addSubview:imageView];
xPos += imageSize.width;
}
You can also disable bounce, scroll indicators, etc. depending on the details of the desired effect.
source
share