State
public final class State
The state represents the entire state of the OS, including all known windows, applications, and spaces.
-
The currently running applications.
Declaration
Swift
public var runningApplications: [Application] { get }
-
The frontmost application.
Declaration
Swift
public var frontmostApplication: WriteableProperty<OfOptionalType<Application>> { get }
-
All windows that we know about. Windows on spaces that we haven’t seen yet aren’t included.
Declaration
Swift
public var knownWindows: [Window] { get }
-
The physical screens in the current display configuration.
Declaration
Swift
public var screens: [Screen] { get }
-
Calls
handler
when the specifiedEvent
occurs.Declaration
Swift
public func on<Event: EventType>(_ handler: @escaping (Event) -> Void)