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 }
-
The main screen, if any.
Declaration
Swift
public var mainScreen: Screen? { get }
-
Calls
handler
when the specifiedEvent
occurs.Declaration
Swift
public func on<Event>(_ handler: @escaping (Event) -> Void) where Event : EventType