Rotation

The only thing not working correctly is changing orientations. If you change to landscape, the images are not resized, and the scroll view pages based on its wider size. That means the paging is off.

You need to regenerate the content view when the screen rotates. Make two changes to make rotation work. First, add the following method below viewDidLoad:

- (void)willAnimateRotationToInterfaceOrientation:                 (UIInterfaceOrientation)toInterfaceOrientation                                          duration:(NSTimeInterval)duration {     [super willAnimateRotationToInterfaceOrientation:toInterfaceOrientation                                             duration:duration];     [self setupScrollContent]; ...

Get Learning iOS Development: A Hands-on Guide to the Fundamentals of iOS Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.