Apr 27, 2011

Slider class to preview Images or PDF

Finally I was able to find some time to write another post on this blog :)
This time I want to share with you my last github repository in which I put a Xcode4 project of a UISlider subclass that I called PQSliderPreview.
The class and the related demo application (that can be run on iPhone or iPad) wants to show the functionality of the PWSliderPreview which can make a preview of the given PDF document or the array of paths of given images.
The PQSliderPreview can extract the PDF pages or the images at the given path and show it as a preview according to the integer retrieved from the slider.
The snapshot below has been taken from my iPhone and show the preview of the test PDF document present into the demo application.


For the preview image I decided to not use the UIPopoverController to show the preview, but manage manually the position of the UIImageView over the UISlider so to have the same representation for iPHone and iPad.
The UIImageView is positioned in manned that it is always visible inside the space assigned to the slider, so the bottom slider shows the preview over it, while the upper one shows the preview below it.

Feel free to download the source code from github and send me back your comments, opinion and how to improve it. The code is under the Apache 2 License.
Enhanced by Zemanta

1 comment: