captureScreenshot(rect:configuration:completionHandler:)
Declaration
class func captureScreenshot(rect: CGRect, configuration config: SCScreenshotConfiguration, completionHandler: (@Sendable (SCScreenshotOutput?, (any Error)?) -> Void)? = nil)class func captureScreenshot(rect: CGRect, configuration config: SCScreenshotConfiguration) async throws -> SCScreenshotOutputParameters
- rect:
The rect for the region in points on the screen space for the screen shot, this is display agnostic and supports multiple displays
- 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
captureScreenshotWithRect:configuration:completionHandler:
this method returns an SCScreenshotOutput object containing CGImages of the screenshot requested by the client