Contents

endBackgroundTask(_:)

Marks the end of a specific long-running background task.

Declaration

nonisolated func endBackgroundTask(_ identifier: UIBackgroundTaskIdentifier)

Parameters

Mentioned in

Discussion

You must call this method to end a task that was started using the beginBackgroundTask(expirationHandler:) method. If you do not, the system may terminate your app.

This method can be safely called on a non-main thread.

See Also

Managing background tasks