getExcludingDesktopWindows(_:onScreenWindowsOnlyAbove:completionHandler:)
Retrieves the displays, apps, and windows that are in front of the specified window.
Declaration
class func getExcludingDesktopWindows(_ excludeDesktopWindows: Bool, onScreenWindowsOnlyAbove window: SCWindow, completionHandler: @escaping @Sendable (SCShareableContent?, (any Error)?) -> Void)class func excludingDesktopWindows(_ excludeDesktopWindows: Bool, onScreenWindowsOnlyAbove window: SCWindow) async throws -> SCShareableContentParameters
- excludeDesktopWindows:
A Boolean value that indicates whether to exclude desktop windows like Finder, Dock, and Desktop from the set of shareable content.
- window:
The window above which to retrieve 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.