NimbusKit
1.2.1 - Fork Nimbus on Github - Visit the Nimbus Wiki
The iOS framework that grows only as fast as its documentation
|
A paged scroll view that shows a collection of photos.
This view provides a light-weight implementation of a photo viewer, complete with pinch-to-zoom and swiping to change photos. It is designed to perform well with large sets of photos and large images that are loaded from either the network or disk.
It is intended for this view to be used in conjunction with a view controller that implements the data source protocol and presents any required chrome.
The data source for this photo album view.
This is the only means by which this photo album view acquires any information about the album to be displayed.
The delegate for this photo album view.
Any user interactions or state changes are sent to the delegate through this property.
Whether zooming is enabled or not.
Regardless of whether this is enabled, only original-sized images will be zoomable. This is because we often don't know how large the final image is so we can't calculate min and max zoom amounts correctly.
By default this is YES.
Whether small photos can be zoomed at least until they fit the screen.
By default this is YES.
The background color of each photo's view.
By default this is [UIColor blackColor].
An image that is displayed while the photo is loading.
This photo will be presented if no image is returned in the data source's implementation of photoAlbumScrollView:photoAtIndex:photoSize:isLoading:.
Zooming is disabled when showing a loading image, regardless of the state of zoomingIsEnabled.
By default this is nil.
Notify the scroll view that a photo has been loaded at a given index.
You should notify the completed loading of thumbnails as well. Calling this method is fairly lightweight and will only update the images of the visible pages. Err on the side of calling this method too much rather than too little.
The photo at the given index will only be replaced with the given image if photoSize is of a higher quality than the currently-displayed photo's size.
The current center page index.
This is a zero-based value. If you intend to use this in a label such as "page ## of n" be sure to add one to this value.
Setting this value directly will center the new page without any animation.
The total number of pages in this paging view, as gathered from the data source.
This value is cached after reloadData has been called.
Until reloadData is called the first time, numberOfPages will be NIPagingScrollViewUnknownNumberOfPages.
The number of pixels on either side of each page.
The space between each page will be 2x this value.
By default this is NIPagingScrollViewDefaultPageMargin.
The type of paging scroll view to display.
This property allows you to configure whether you want a horizontal or vertical paging scroll view. You should set this property before you present the scroll view and not modify it after.
By default this is NIPagingScrollViewHorizontal.
Force the view to reload its data by asking the data source for information.
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 cheap because we only fetch new information about the currently displayed pages. If the number of pages shrinks then the current center page index will be decreased accordingly.
Dequeues a reusable page from the set of recycled pages.
If no pages have been recycled for the given identifier then this will return nil. In this case it is your responsibility to create a new page.
The current center page view.
If no pages exist then this will return nil.
Returns YES if there is a next page.
Returns YES if there is a previous page.
Move to the next page if there is one.
Move to the previous page if there is one.
Move to the given page index with optional animation and option to enable page updates while scrolling.
NOTE: Passing YES for moveToPageAtIndex:animated:updateVisiblePagesWhileScrolling will cause every page from the present page to the destination page to be loaded. This has the potential to cause choppy animations.
updateVisiblePagesWhileScrolling | If YES, will query the data source for any pages that become visible while the animation occurs. |
Move to the given page index with optional animation.
Stores the current state of the scroll view in preparation for rotation.
This must be called in conjunction with willAnimateRotationToInterfaceOrientation:duration: in the methods by the same name from the view controller containing this view.
Updates the frame of the scroll view while maintaining the current visible page's state.
The user has double-tapped the photo to zoom either in or out.
photoScrollView | The photo scroll view that was tapped. |
didZoomIn | YES if the photo was zoomed in. NO if the photo was zoomed out. |