performChangesAndWait(_:)
Synchronously runs a block that requests changes to be performed in the photo library.
Declaration
func performChangesAndWait(_ changeBlock: @escaping () -> Void) throwsParameters
- changeBlock:
A block that requests changes to be performed.
This block takes no parameters and has no return value.
Mentioned in
Discussion
Do not call this method from the main thread. Your change block, and the work that Photos performs on your behalf to apply the changes it requests, take some time to execute. (Photos may need to prompt the user to perform changes, so this method can block execution indefinitely.) Use this method if you are already performing work on a background queue that results in a change to be applied to the Photos library. To request changes from the main queue, use the performChanges(_:completionHandler:) method instead.