Instance Method

performActivity(options:reason:using:)

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

Declaration

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

Parameters

options

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

reason

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

block

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

Discussion

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