getWithCompletionHandler(_:)
Retrieves the displays, apps, and windows that your app can capture.
Declaration
class func getWithCompletionHandler(_ completionHandler: @escaping @Sendable (SCShareableContent?, (any Error)?) -> Void)class var current: SCShareableContent { get async throws }Parameters
- completionHandler:
A callback the system invokes with the shareable content, or an error if a failure occurs.
Discussion
Use this method to retrieve the onscreen content that your app can capture. If the call is successful, the system returns the shareable content to the completion handler; otherwise, it returns an error that describes the failure.