importResources(from:importRequest:progress:)
Tells the migration extension to begin importing transportable resources into the app extension.
Declaration
final func importResources(from extractedResourceURL: URL, importRequest: ResourcesImportRequest? = nil, progress: Progress? = nil) async throwsParameters
- extractedResourceURL:
A file URL pointing to a directory that contains the resources to import.
- importRequest:
An optional migration request instance to pass to the app extension’s import method. If this value is
nil, the framework uses a default request. This value defaults tonil. - progress:
An optional Progress object the extension uses to report its progress back to the unit test. This value defaults to
nil.
Discussion
Clean your app state before starting an import test, since the app extension runs on a clean app state. In particular, remove any files you previously wrote to the app container and ensure it’s empty. This simulates how the extension normally runs during a migration.