PSPDFGalleryView
Objective-C
@interface PSPDFGalleryView : UIScrollView <PSPDFOverridable>
Swift
class GalleryView : UIScrollView, Overridable
A gallery view works a lot like a UITableView
. It has content views, which need to be provided by
a data source and can be reused. It is built on top of a UIScrollView
.
-
The data source of the gallery view.
Declaration
Objective-C
@property (nonatomic, weak) id<PSPDFGalleryViewDataSource> _Nullable dataSource;
Swift
weak var dataSource: GalleryViewDataSource? { get set }
-
The padding between successive content views. Defaults to 5.0.
Declaration
Objective-C
@property (nonatomic) CGFloat contentPadding;
Swift
var contentPadding: CGFloat { get set }
-
Undocumented
Declaration
Objective-C
- (void)setDelegate:(nullable id<PSPDFGalleryViewDelegate>)delegate;
Swift
func setDelegate(_ delegate: GalleryViewDelegate?)
-
Undocumented
Declaration
Objective-C
- (nullable id<PSPDFGalleryViewDelegate>)delegate;
Swift
func delegate() -> GalleryViewDelegate?
-
Reloads the gallery view.
-
Returns the
PSPDFGalleryContentView
for the given item index ornil
if does not exist or is not part ofactiveContentViews
.Declaration
Objective-C
- (nullable PSPDFGalleryContentView *)contentViewForItemAtIndex: (NSUInteger)index;
Swift
func contentViewForItem(at index: UInt) -> PSPDFGalleryContentView?
-
Returns the index for a given content view or
NSNotFound
if the content view cannot be matched to an index.Declaration
Objective-C
- (NSUInteger)itemIndexForContentView: (nonnull PSPDFGalleryContentView *)contentView;
Swift
func itemIndex(for contentView: PSPDFGalleryContentView) -> UInt
-
Returns a reusable content view for a given identifier or
nil
if no content view is available for reuse.Declaration
Objective-C
- (nullable PSPDFGalleryContentView *)dequeueReusableContentViewWithIdentifier: (nonnull NSString *)identifier;
Swift
func dequeueReusableContentView(withIdentifier identifier: String) -> PSPDFGalleryContentView?
-
The currently visible item index.
Declaration
Objective-C
@property (nonatomic) NSUInteger currentItemIndex;
Swift
var currentItemIndex: UInt { get set }
-
Sets the currently visible item index with or without animation.
Declaration
Objective-C
- (void)setCurrentItemIndex:(NSUInteger)currentItemIndex animated:(BOOL)animated;
Swift
func setCurrentItemIndex(_ currentItemIndex: UInt, animated: Bool)
-
The currently active content views, that is the content views that are visible or are next to a visible content view.
Declaration
Objective-C
@property (nonatomic, readonly) NSSet<PSPDFGalleryContentView *> *_Nonnull activeContentViews;
Swift
var activeContentViews: Set<AnyHashable> { get }
-
Enables the loop mode, where the gallery wraps around at both ends. Defaults to
false
.Note
Loop mode is only usable if more than two items are presented. Otherwise this setting will be ignored.Declaration
Objective-C
@property (nonatomic, getter=isLoopEnabled) BOOL loopEnabled;
Swift
var isLoopEnabled: Bool { get set }