endBackgroundTask(_:)
Marks the end of a specific long-running background task.
Declaration
nonisolated func endBackgroundTask(_ identifier: UIBackgroundTaskIdentifier)Parameters
- identifier:
An identifier returned by the Beginbackgroundtask(expirationhandler:) method.
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.