Instance Method


Synchronously perform an activity defined by a given block using the given options.


func performActivity(options: ProcessInfo.ActivityOptions = [], reason: String, using block: @escaping () -> Void)



Options for the activity. See ProcessInfo.ActivityOptions for possible values.


A string used in debugging to indicate the reason the activity began.


A block containing the work to be performed by the activity.


The activity will be automatically ended after block returns.

See Also

Managing Activities

func endActivity(NSObjectProtocol)

Ends the given activity.

func performExpiringActivity(withReason: String, using: (Bool) -> Void)

Performs the specified block asynchronously and notifies you if the process is about to be suspended.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software