Thumbnail slider

The ThumbnailSliderViewController class allows the user to quickly navigate through a document. When using the slider control, a small page preview pop will be shown on top of the thumbnail slider.

The thumbnail slider control is part of the Tools library, so make sure you have added the Tools library to your project.

Showing a thumbnail slider

To create and set up a thumbnail slider, supply a PTPDFViewCtrl instance to the ThumbnailSliderViewController designated initializer:

Populating with thumbnail images

The thumbnail images shown in the thumbnail slider view controller are generated by the GetThumbAsync: method of the PTPDFViewCtrl class. When ready, the thumbnail images are provided to the pdfviewCtrl's delegate via the pdfViewCtrl:gotThumbAsync:thumbImage: method.

In your class adopting the PTPDFViewCtrlDelegate protocol (usually the same view controller containing the thumbnail slider view controller), add the following:

Updating the position of the slider

When the current page in the associated PTPDFViewCtrl changes, the thumbnail slider must be updated for the new page number. This is done from the pdfViewCtrl:pageNumberChangedFrom:To: method of the PTPDFViewCtrlDelegate protocol:

The Thumbnail Slider Delegate

The ThumbnailSliderViewDelegate protocol allows the adopting class (usually the containing view controller, as in this guide) to be notified when the user is actively using the thumbnail slider. The thumbnail slider already handles changing the current page in response to user actions, but the delegate methods can be used to hide or show other content as appropriate.