PSPDFScreenControllerDelegate

@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 `PSPDFViewController` 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 `PSPDFPageTransitionScrollPerSpread` 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 `PSPDFConfiguration` for details.
 */
- (PSPDFViewController *)createPDFViewControllerForMirroring:(PSPDFScreenController *)screenController;

/**
 This delegate can be used to decide wheter 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

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 PSPDFViewController 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: PSPDFScreenController, 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: PSPDFScreenController, 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

    PSPDFPageTransitionScrollPerSpread 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 PSPDFConfiguration for details.

    Declaration

    Objective-C

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

    Swift

    optional func createPDFViewController(forMirroring screenController: PSPDFScreenController) -> PSPDFViewController
  • This delegate can be used to decide wheter 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: PSPDFScreenController, shouldSyncConfigurationTo mirroredPDFController: PSPDFViewController) -> Bool