PSPDFScreenControllerDelegate

Objective-C

@protocol PSPDFScreenControllerDelegate<NSObject>

@optional

/// Started mirroring on `screen`.
///
/// This delegate is called after the `UIWindow` has been created and the `rootViewController` is configured.
/// Use this for additional customization.
///
/// @note Replacing the `rootViewController` on the mirroring window is supported,
/// as long as the `PDFViewController` is correctly registered as a child view controller.
///
/// Use `mirrorControllerForScreen:` to access the window if required.
- (void)screenController:(PSPDFScreenController *)screenController didStartMirroringForScreen:(UIScreen *)screen;

/// Stopped mirroring on `screen`.
///
/// This delegate is called after the mirroring window is hidden and is about to be deallocated.
- (void)screenController:(PSPDFScreenController *)screenController didStopMirroringForScreen:(UIScreen *)screen;

/// Implement this method to return a custom controller that should be used for mirroring.
/// If you return a custom controller, ensure that it is configured correctly.
///
/// This is called just before mirroring starts.
///
/// @note The default implementation uses various sensible options such as
/// hiding the thumbnail bar, document label and page label. It also completely mirrors the most relevant
/// configuration settings of the original controller.
///
/// @warning `PageTransition.scrollPerSpread` is the only supported page mode for mirroring currently.
///
/// Gallery considerations: We recommend at least following options to ensure the gallery works as expected:
/// `builder.allowPlayingMultipleInstances = YES;`
/// `builder.usesExternalPlaybackWhileExternalScreenIsActive = NO;`
/// See `galleryConfiguration` on `PDFConfiguration` for details.
- (PSPDFViewController *)createPDFViewControllerForMirroring:(PSPDFScreenController *)screenController;

/// This delegate can be used to decide whether the mirrored controller should copy the configuration of the original controller or not.
///
/// If not implemented, defaults to YES.
- (BOOL)screenController:(PSPDFScreenController *)screenController shouldSyncConfigurationTo:(PSPDFViewController *)mirroredPDFController;

@end

Swift

protocol ScreenControllerDelegate : NSObjectProtocol

Undocumented

  • Started mirroring on screen.

    This delegate is called after the UIWindow has been created and the rootViewController is configured. Use this for additional customization.

    Note

    Replacing the rootViewController on the mirroring window is supported, as long as the PDFViewController is correctly registered as a child view controller.

    Use mirrorControllerForScreen: to access the window if required.

    Declaration

    Objective-C

    - (void)screenController:(nonnull PSPDFScreenController *)screenController
        didStartMirroringForScreen:(nonnull UIScreen *)screen;

    Swift

    optional func screenController(_ screenController: ScreenController, didStartMirroringFor screen: UIScreen)
  • Stopped mirroring on screen.

    This delegate is called after the mirroring window is hidden and is about to be deallocated.

    Declaration

    Objective-C

    - (void)screenController:(nonnull PSPDFScreenController *)screenController
        didStopMirroringForScreen:(nonnull UIScreen *)screen;

    Swift

    optional func screenController(_ screenController: ScreenController, didStopMirroringFor screen: UIScreen)
  • Implement this method to return a custom controller that should be used for mirroring. If you return a custom controller, ensure that it is configured correctly.

    This is called just before mirroring starts.

    Note

    The default implementation uses various sensible options such as hiding the thumbnail bar, document label and page label. It also completely mirrors the most relevant configuration settings of the original controller.

    Warning

    PageTransition.scrollPerSpread is the only supported page mode for mirroring currently.

    Gallery considerations: We recommend at least following options to ensure the gallery works as expected: builder.allowPlayingMultipleInstances = YES; builder.usesExternalPlaybackWhileExternalScreenIsActive = NO; See galleryConfiguration on PDFConfiguration for details.

    Declaration

    Objective-C

    - (nonnull PSPDFViewController *)createPDFViewControllerForMirroring:
        (nonnull PSPDFScreenController *)screenController;

    Swift

    optional func createPDFViewController(forMirroring screenController: ScreenController) -> PSPDFViewController
  • This delegate can be used to decide whether the mirrored controller should copy the configuration of the original controller or not.

    If not implemented, defaults to YES.

    Declaration

    Objective-C

    - (BOOL)screenController:(nonnull PSPDFScreenController *)screenController
        shouldSyncConfigurationTo:
            (nonnull PSPDFViewController *)mirroredPDFController;

    Swift

    optional func screenController(_ screenController: ScreenController, shouldSyncConfigurationTo mirroredPDFController: PSPDFViewController) -> Bool