beginAccessingResources(completionHandler:)
Requests access to the resources marked with the managed tags. If any of the resources are not on the device, they are requested from the App Store.
Declaration
func beginAccessingResources(completionHandler: @escaping @Sendable ((any Error)?) -> Void)func beginAccessingResources() async throwsParameters
- completionHandler:
A block called when the resources have finished downloading or if an error occurs. The resources are not available until the completion handler is called with
errorset tonil.The block takes the following parameter:
- error
Set to
nilif the resources are downloaded successfully; otherwise this parameter holds an Nserror object describing the problem that occurred. Errors are usually due to a lack of free space or problems connecting with the App Store.
Discussion
After calling this method, the resource request downloads any on-demand resources not already on the device. When all the resources are downloaded, they are marked as non-purgeable. The resources are not available to the app until the completion handler is called with no error.