PTThumbnailsViewController


@interface PTThumbnailsViewController
    : UIViewController <PTOverridable, UICollectionViewDataSource,
                        UICollectionViewDelegateFlowLayout,
                        UIPopoverPresentationControllerDelegate>

Displays a grid of thumbnails that can be used for navigation, plus re-arranging and deleting pages.

  • Initializes a new instance of the class.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithPDFViewCtrl:
        (nonnull PTPDFViewCtrl *)pdfViewCtrl;

    Swift

    init(pdfViewCtrl: PTPDFViewCtrl)

    Parameters

    pdfViewCtrl

    The PTPDFViewCtrl instance that the control will coordinate with.

  • Initializes a new instance of the class.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithToolManager:
        (nonnull PTToolManager *)toolManager;

    Swift

    convenience init(toolManager: PTToolManager)

    Parameters

    toolManager

    The PTToolManager instance that the control will coordinate with.

  • The collection view object managed by this view controller.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) UICollectionView *_Nonnull collectionView;

    Swift

    var collectionView: UICollectionView { get }
  • The PTAddPagesViewController managed by this view controller.

    Declaration

    Objective-C

    @property (nonatomic, strong) PTAddPagesViewController *_Nonnull addPagesViewController;

    Swift

    var addPagesViewController: PTAddPagesViewController { get set }
  • Whether editing of thumbnails is allowed. The default is YES.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isEditingEnabled) BOOL editingEnabled;

    Swift

    var isEditingEnabled: Bool { get set }
  • Whether editing of thumbnails is supported. Some modes of opperation do not support editing and so the edit button will be disabled even if editingEnabled is true.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readonly,
              getter=isEditingSupported) BOOL editingSupported;

    Swift

    var isEditingSupported: Bool { get }
  • Whether adding pages is allowed. The default is YES.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isAddPagesEnabled) BOOL addPagesEnabled;

    Swift

    var isAddPagesEnabled: Bool { get set }
  • Whether exporting pages is allowed. The default is YES.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isExportPagesEnabled) BOOL exportPagesEnabled;

    Swift

    var isExportPagesEnabled: Bool { get set }
  • Whether rotating pages is allowed. The default is YES.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isRotatePagesEnabled) BOOL rotatePagesEnabled;

    Swift

    var isRotatePagesEnabled: Bool { get set }
  • Whether deleting pages is allowed. The default is YES.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isDeletePagesEnabled) BOOL deletePagesEnabled;

    Swift

    var isDeletePagesEnabled: Bool { get set }
  • Whether duplicating pages is allowed. The default is YES.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isDuplicatePagesEnabled) BOOL duplicatePagesEnabled;

    Swift

    var isDuplicatePagesEnabled: Bool { get set }
  • An ordered set of PTFilterMode enums used to filter the thumbnails.

    If the set contains fewer than two filter modes then the filter control will not be shown.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSOrderedSet<PTFilterMode> *filterModes;

    Swift

    @NSCopying var filterModes: NSOrderedSet? { get set }
  • The currently selected filter mode.

    Declaration

    Objective-C

    @property (nonatomic, copy) PTFilterMode _Nonnull filterMode;

    Swift

    var filterMode: PTFilterMode { get set }
  • Rotates the selected pages clockwise.

    Declaration

    Objective-C

    - (void)rotatePagesClockwise;

    Swift

    func rotatePagesClockwise()
  • Rotates the selected pages clockwise.

    Declaration

    Objective-C

    - (void)rotatePagesCounterClockwise;

    Swift

    func rotatePagesCounterClockwise()
  • If the done button should be shown.

    Declaration

    Objective-C

    - (BOOL)showsDoneButton;

    Swift

    func showsDoneButton() -> Bool
  • Called when something happens that indicates the title might need to update

    Declaration

    Objective-C

    - (void)updateTitle;

    Swift

    func updateTitle()
  • Associates a thumbnail image with a page number

    Declaration

    Objective-C

    - (void)setThumbnail:(nonnull UIImage *)image forPage:(NSInteger)pageNum;

    Swift

    func setThumbnail(_ image: UIImage, forPage pageNum: Int)

    Parameters

    image

    The image of the page.

    pageNum

    The page number of the page.

  • Creates a new PTPDFDoc with the selected pages

    Declaration

    Objective-C

    - (nonnull PTPDFDoc *)exportPagesToDoc;

    Swift

    func exportPagesToDoc() -> PTPDFDoc
  • Undocumented

    Declaration

    Objective-C

    - (instancetype)initWithNibName:(nullable NSString *)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil NS_UNAVAILABLE;
  • Undocumented

    Declaration

    Objective-C

    - (instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE;
  • Undocumented

    Declaration

    Objective-C

    - (instancetype)init NS_UNAVAILABLE;