PSPDFAppearanceModeManager

Objective-C


@interface PSPDFAppearanceModeManager : NSObject <PSPDFOverridable>

Swift

class PDFAppearanceModeManager : NSObject, Overridable

Coordinates appearance mode changes.

On iOS versions prior to iOS 13, this class will update the PDF page rendering style, as well as the UI appearance of certain UI widgets when transitioning in and out of the dark interface style.

On iOS 13 and later the this class will only change the PDF page rendering style. Any UI appearance changes should be instead handled by the host application via the delegate methods this class offers.

  • The currently selected appearance mode. Defaults to PSPDFAppearanceModeDefault.

    Declaration

    Objective-C

    @property (nonatomic, assign, unsafe_unretained, readwrite)
        PSPDFAppearanceMode appearanceMode;

    Swift

    var appearanceMode: PDFAppearanceMode { get set }
  • Sets the appearance mode.

    Declaration

    Objective-C

    - (void)setAppearanceMode:(PSPDFAppearanceMode)appearanceMode
                     animated:(BOOL)animated;

    Swift

    func setAppearanceMode(_ appearanceMode: PDFAppearanceMode, animated: Bool)

    Parameters

    appearanceMode

    The new mode to apply.

    animated

    Fades any theme changes if set to YES. This parameter is not relevant on iOS 13 and later.

  • The appearance delegate. Can be used to customize the default behaviors for each mode.

    Declaration

    Objective-C

    @property (nonatomic, weak, readwrite)
        id<PSPDFAppearanceModeManagerDelegate> _Nullable delegate;

    Swift

    weak var delegate: AppearanceModeManagerDelegate? { get set }