PSPDFGalleryView


@interface PSPDFGalleryView : UIScrollView

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 (readwrite, nonatomic)
        id<PSPDFGalleryViewDataSource> _Nullable dataSource;

    Swift

    weak var dataSource: PSPDFGalleryViewDataSource? { get set }
  • The padding between successive content views. Defaults to 5.0.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) CGFloat contentPadding;

    Swift

    var contentPadding: CGFloat { get set }
  • Undocumented

    Declaration

    Objective-C

    - (void)setDelegate:(nullable id<PSPDFGalleryViewDelegate>)delegate;

    Swift

    func setDelegate(_ delegate: PSPDFGalleryViewDelegate?)
  • Undocumented

    Declaration

    Objective-C

    - (nullable id<PSPDFGalleryViewDelegate>)delegate;

    Swift

    func delegate() -> PSPDFGalleryViewDelegate?
  • Reloads the gallery view.

    Declaration

    Objective-C

    - (void)reload;

    Swift

    func reload()
  • Returns the PSPDFGalleryContentView for the given item index or nil if does not exist or is not part of activeContentViews.

    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 (assign, readwrite, 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 (readonly, nonatomic)
        NSSet<PSPDFGalleryContentView *> *_Nonnull activeContentViews;

    Swift

    var activeContentViews: Set<AnyHashable> { get }
  • Enables the loop mode, where the gallery wraps around at both ends. Defaults to NO.

    Note

    Loop mode is only usable if more than two items are presented. Otherwise this setting will be ignored.

    Declaration

    Objective-C

    @property (getter=isLoopEnabled, assign, readwrite, nonatomic) BOOL loopEnabled;

    Swift

    var isLoopEnabled: Bool { get set }