Instance Property

runningApplications

Returns an array of running apps.

Declaration

var runningApplications: [NSRunningApplication] { get }

Return Value

An array of NSRunningApplication instances. This value is key-value observing compliant.

Discussion

The order of the array is unspecified, but it is stable, meaning that the relative order of particular apps will not change across multiple calls to runningApplications. See NSRunningApplication for more information on NSRunningApplication.

Similar to the NSRunningApplication class’s properties, this property will only change when the main run loop runs in a common mode. Instead of polling, use key-value observing to be notified of changes to this array property.

You can safely call this method from any of your app’s threads. The method returns its value atomically.