Contents

captureScreenshot(contentFilter:configuration:completionHandler:)

Declaration

class func captureScreenshot(contentFilter: SCContentFilter, configuration config: SCScreenshotConfiguration, completionHandler: (@Sendable (SCScreenshotOutput?, (any Error)?) -> Void)? = nil)
class func captureScreenshot(contentFilter: SCContentFilter, configuration config: SCScreenshotConfiguration) async throws -> SCScreenshotOutput

Parameters

  • contentFilter:

    Is the filter containing the content to take a screenshot of

  • config:

    Is the screenshot configuration containing information on how to format the screenshot

  • completionHandler:

    Is the handler that will deliver the SCScreenshotOutput object to the client

Discussion

captureScreenshotWithFilter:configuration:completionHandler:

this method returns an SCScreenshotOutput object containing CGImages of the screenshot requested by the client