PSPDFGalleryContentView


@interface PSPDFGalleryContentView : UIView

The (reusable) content view of a PSPDFGalleryView.

  • Convenience initializer. Creates a new content view with a reuse identifier. It is highly recommended that you always reuse content views to avoid performance issues. The API works exactly like UITableView.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithReuseIdentifier:
        (nullable NSString *)reuseIdentifier;

    Swift

    init(reuseIdentifier: String?)
  • The reuse identifier if the view was created with initWithReuseIdentifier:. You should always reuse views to avoid performance issues.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *reuseIdentifier;

    Swift

    var reuseIdentifier: String? { get set }
  • The content item.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, nullable) PSPDFGalleryItem *content;

    Swift

    var content: PSPDFGalleryItem? { get set }
  • Indicates if the caption should be visible. Defaults to NO. - note: This property is only a hint to the content view. The caption might still be hidden even if this property is set to NO.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL shouldHideCaption;

    Swift

    var shouldHideCaption: Bool { get set }
  • Returns the class for contentView. Defaults to Nil. - note: The class must be a subclass of UIView. - warning: This is an abstract class. Your subclass must override this method!

    Declaration

    Objective-C

    + (nonnull Class)contentViewClass;

    Swift

    class func contentViewClass() -> AnyClass
  • Returns the class for loadingView. Defaults to PSPDFCircularProgressView. - note: The class must be a subclass of UIView and conform to the PSPDFGalleryContentViewLoading protocol.

    Declaration

    Objective-C

    + (nonnull Class)loadingViewClass;

    Swift

    class func loadingViewClass() -> AnyClass
  • Returns the class for captionView. Defaults to PSPDFGalleryContentCaptionView.class. - note: The class must be a subclass of UIView and conform to the PSPDFGalleryContentViewCaption protocol.

    Declaration

    Objective-C

    + (nonnull Class)captionViewClass;

    Swift

    class func captionViewClass() -> AnyClass
  • Returns the class for errorView. Defaults to PSPDFErrorView.class. - note: The class must be a subclass of UIView and conform to the PSPDFGalleryContentViewError protocol.

    Declaration

    Objective-C

    + (nonnull Class)errorViewClass;

    Swift

    class func errorViewClass() -> AnyClass
  • The frame of the content view.

    Declaration

    Objective-C

    @property (readonly, nonatomic) CGRect contentViewFrame;

    Swift

    var contentViewFrame: CGRect { get }
  • The frame of the loading view.

    Declaration

    Objective-C

    @property (readonly, nonatomic) CGRect loadingViewFrame;

    Swift

    var loadingViewFrame: CGRect { get }
  • The frame of the caption view.

    Declaration

    Objective-C

    @property (readonly, nonatomic) CGRect captionViewFrame;

    Swift

    var captionViewFrame: CGRect { get }
  • The frame of the error view.

    Declaration

    Objective-C

    @property (readonly, nonatomic) CGRect errorViewFrame;

    Swift

    var errorViewFrame: CGRect { get }
  • Updates the content view’s contents. - warning: This is an abstract class. Your subclass must override this method!

    Declaration

    Objective-C

    - (void)updateContentView;

    Swift

    func updateContentView()
  • Updates the caption view’s contents.

    Declaration

    Objective-C

    - (void)updateCaptionView;

    Swift

    func updateCaptionView()
  • Updates the error view’s contents.

    Declaration

    Objective-C

    - (void)updateErrorView;

    Swift

    func updateErrorView()
  • Updates the loading view’s contents.

    Declaration

    Objective-C

    - (void)updateLoadingView;

    Swift

    func updateLoadingView()
  • Called before reusing the content view to give it a chance to restore its initial state.

    Declaration

    Objective-C

    - (void)prepareForReuse;

    Swift

    func prepareForReuse()
  • Use this method to update your content view.

    Declaration

    Objective-C

    - (void)contentDidChange;

    Swift

    func contentDidChange()
  • Called when the view state of the content view has changed and subview visibility is likely going to change.

    Declaration

    Objective-C

    - (void)updateSubviewVisibility;

    Swift

    func updateSubviewVisibility()