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 tofalse
.Declaration
Objective-C
@property (nonatomic) BOOL shouldHideCaption;
Swift
var shouldHideCaption: Bool { get set }
-
Returns the class for
contentView
. Defaults toNil
.Note
The class must be a subclass ofUIView
.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 toPSPDFCircularProgressView
.Note
The class must be a subclass ofUIView
and conform to thePSPDFGalleryContentViewLoading
protocol.Declaration
Objective-C
+ (nonnull Class)loadingViewClass;
Swift
class func loadingViewClass() -> AnyClass
-
Returns the class for
captionView
. Defaults toPSPDFGalleryContentCaptionView.class
.Note
The class must be a subclass ofUIView
and conform to thePSPDFGalleryContentViewCaption
protocol.Declaration
Objective-C
+ (nonnull Class)captionViewClass;
Swift
class func captionViewClass() -> AnyClass
-
Returns the class for
errorView
. Defaults toPSPDFErrorView.class
.Note
The class must be a subclass ofUIView
and conform to thePSPDFGalleryContentViewError
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! -
Updates the caption view’s contents.
-
Updates the error view’s contents.
-
Updates the loading view’s contents.
-
Called before reusing the content view to give it a chance to restore its initial state.
-
Use this method to update your content view.
-
Called when the view state of the content view has changed and subview visibility is likely going to change.