PSPDFGalleryContentView

Objective-C


@interface PSPDFGalleryContentView : UIView

Swift

class GalleryContentView : 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 content view.

    Declaration

    Objective-C

    @property (nonatomic, readonly) UIView *_Nonnull contentView;

    Swift

    var contentView: UIView { get }
  • The loading view.

    Declaration

    Objective-C

    @property (nonatomic, readonly) UIView<PSPDFGalleryContentViewLoading> *_Nonnull loadingView;

    Swift

    var loadingView: UIView & GalleryContentViewLoading { get }
  • The caption view.

    Declaration

    Objective-C

    @property (nonatomic, readonly) UIView<PSPDFGalleryContentViewCaption> *_Nonnull captionView;

    Swift

    var captionView: UIView & GalleryContentViewCaption { get }
  • The error view.

    Declaration

    Objective-C

    @property (nonatomic, readonly) UIView<PSPDFGalleryContentViewError> *_Nonnull errorView;

    Swift

    var errorView: UIView & GalleryContentViewError { get }
  • The reuse identifier if the view was created with initWithReuseIdentifier:. You should always reuse views to avoid performance issues.

    Declaration

    Objective-C

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

    Swift

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

    Declaration

    Objective-C

    @property (nonatomic, nullable) PSPDFGalleryItem *content;

    Swift

    var content: PSPDFGalleryItem? { get set }
  • Indicates if the caption should be visible. Defaults to false.

    Note

    This property is only a hint to the content view. The caption might still be hidden even if this property is set to false.

    Declaration

    Objective-C

    @property (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 (nonatomic, readonly) CGRect contentViewFrame;

    Swift

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

    Declaration

    Objective-C

    @property (nonatomic, readonly) CGRect loadingViewFrame;

    Swift

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

    Declaration

    Objective-C

    @property (nonatomic, readonly) CGRect captionViewFrame;

    Swift

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

    Declaration

    Objective-C

    @property (nonatomic, readonly) 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()