The iOS framework that grows only as fast as its documentation
NIPhotoScrubberView Class Reference

Overview

A control built for quickly skimming through a collection of images.

The user interacts with the scrubber by "scrubbing" their finger along the control, or more simply, touching the control and moving their finger along a single axis. Scrubbers can be seen in the Photos.app on the iPad.

The thumbnails displayed in a scrubber will be a subset of the overall set of photos. The wider the scrubber, the more thumbnails will be shown. The displayed thumbnails will be chosen at constant intervals in the album, with a larger "selected" thumbnail image that will show whatever image is currently selected. This larger thumbnail will be positioned relatively within the scrubber to show the user what the current selection is in a physically intuitive way.

This view is a completely independent view from the photo scroll view so you can choose to use this in your already built photo viewer.

scrubber1.png
Screenshot of NIPhotoScrubberView on the iPad.
See Also
NIPhotoScrubberViewDataSource
NIPhotoScrubberViewDelegate

Tasks

Data Source
id< NIPhotoScrubberViewDataSourcedataSource property
 
(void) - reloadData
 
(void) - didLoadThumbnail:atIndex:
 
Delegate
id< NIPhotoScrubberViewDelegatedelegate property
 
Accessing Selection
NSInteger selectedPhotoIndex property
 
(void) - setSelectedPhotoIndex:animated:
 

Method Documentation

dataSource

The data source for this scrubber view.

@property (nonatomic, weak) id<NIPhotoScrubberViewDataSource> dataSource;

delegate

The delegate for this scrubber view.

@property (nonatomic, weak) id<NIPhotoScrubberViewDelegate> delegate;

selectedPhotoIndex

The selected photo index.

@property (nonatomic) NSInteger selectedPhotoIndex;

reloadData

Forces the scrubber view to reload all of its data.

- (void)reloadData;
Discussion

This must be called at least once after dataSource has been set in order for the view to gather any presentable information.

This method is expensive. It will reset the state of the view and remove all existing thumbnails before requesting the new information from the data source.

didLoadThumbnail:atIndex:

Notify the scrubber view that a thumbnail has been loaded at a given index.

- (void)didLoadThumbnail:(UIImage *)image atIndex:(NSInteger)photoIndex;
Discussion

This method is cheap, so do not be afraid to call it whenever a thumbnail loads. It will only modify visible thumbnails.

setSelectedPhotoIndex:animated:

Set the selected photo with animation.

- (void)setSelectedPhotoIndex:(NSInteger)photoIndex animated:(BOOL)animated;