Recipe: Image Gallery Viewer

Recipe 2-10 uses a UIScrollView instance to display multiple images, as shown in Figure 2-10. Users can scroll through the pictures using swipes, and the page indicator updates accordingly. Similarly, users can tap on the page control, and the scroller animates the selected page into place. This two-way relationship is built by adding a target-action callback to the page control and a delegate callback to the scroller. Each callback updates the other object, providing a tight coupling between the two.

Image

Figure 2-10 In iOS 7, content is king. The only interface elements that are visible include the page control and the ...

Get The Core iOS Developer’s Cookbook, Fifth Edition 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.