A resource manager you use to download content hosted on the App Store at the time your app needs it.
SDKs
- iOS 9.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Foundation
Declaration
class NSBundleResourceRequest : NSObject
Overview
You identify on-demand resources during development by creating string identifiers known as tags and assigning one or more tags to each resource. An NSBundle
object manages the resources marked by one or more tags.
You use the resource request to inform the system when the managed tags are needed and when you have finished accessing them. The resource request manages the downloading of any resources marked with the managed tags that are not already on the device and informs your app when the resources are ready for use.
The system will not attempt to purge the resources marked with a tag from on-device storage as long as at least one NSBundle
object is managing the tag. Apps can access resources after the completion handler of either begin
or conditionally
is called successfully. Management ends after a call to end
or after the resource request object is deallocated.
Other properties and methods let you track the progress of a download, change the priority of a download, and check whether the resources marked by a set of tags are already on the device. Methods in Bundle
indicate to the system the relative importance of preserving a tag in memory after it is no longer in use. For more information, see set
and preservation
.
Important
An NSBundle
object can only be used for one successful resource request.