Contents

getExcludingDesktopWindows(_:onScreenWindowsOnly:completionHandler:)

Retrieves the displays, apps, and windows that match your criteria.

Declaration

class func getExcludingDesktopWindows(_ excludeDesktopWindows: Bool, onScreenWindowsOnly: Bool, completionHandler: @escaping  @Sendable (SCShareableContent?, (any Error)?) -> Void)
class func excludingDesktopWindows(_ excludeDesktopWindows: Bool, onScreenWindowsOnly: Bool) async throws -> SCShareableContent

Parameters

  • excludeDesktopWindows:

    A Boolean value that indicates whether to exclude desktop windows like Finder, Dock, and Desktop from the set of shareable content.

  • onScreenWindowsOnly:

    A Boolean value that indicates whether to include only onscreen windows in the set of shareable content.

  • 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 matching your filtering criteria. If the call is successful, the system passes an SCShareableContent instance to the completion handler; otherwise, it returns an error that describes the failure.

See Also

Retrieving shareable content