Instance Property

runningApplications

Returns an array of NSRunningApplication representing the running apps.

Declaration

var runningApplications: [NSRunningApplication] { get }

Return Value

An array of NSRunningApplication instances.

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 is run in a common mode. Instead of polling, use key-value observing to be notified of changes to this array property.

It is safe to call this method from any of your app’s threads. The method returns its value atomically.

This value returned by this method is observable using key-value observing.