urls(forResourcesWithExtension:subdirectory:localization:)
Returns an array containing the file URLs for all bundle resources having the specified filename extension, residing in the specified resource subdirectory, and limited to global resources and those associated with the specified localization.
Declaration
func urls(forResourcesWithExtension ext: String?, subdirectory subpath: String?, localization localizationName: String?) -> [URL]?Parameters
- ext:
The filename extension of the files to locate.
If you specify an empty string or
nil, the extension is assumed not to exist and all of the files insubpathare returned. - subpath:
The name of the bundle subdirectory to search.
- localizationName:
The language ID for the localization. This parameter should correspond to the name of one of the bundle’s language-specific resource directories without the
.lprojextension.
Return Value
An array containing the file URLs for all bundle resources matching the specified criteria. This method returns an empty array if no matching resource files are found.
Discussion
This method is equivalent to urls(forResourcesWithExtension:subdirectory:), except that only nonlocalized resources and those in the language-specific .lproj directory specified by localizationName are searched.
See Also
Finding Resource Files
url(forResource:withExtension:subdirectory:)url(forResource:withExtension:)urls(forResourcesWithExtension:subdirectory:)url(forResource:withExtension:subdirectory:localization:)url(forResource:withExtension:subdirectory:in:)urls(forResourcesWithExtension:subdirectory:in:)path(forResource:ofType:)path(forResource:ofType:inDirectory:)path(forResource:ofType:inDirectory:forLocalization:)paths(forResourcesOfType:inDirectory:)paths(forResourcesOfType:inDirectory:forLocalization:)path(forResource:ofType:inDirectory:)paths(forResourcesOfType:inDirectory:)