Skip to content

Commit d9d1148

Browse files
committed
Make URL-/pathForResource lookup global and local
Docs state that explicit `nil` for localization will not look up resources in the localization folders. That is not what we want, so remove them here and use the overload that looks in all places. :)
1 parent a01810a commit d9d1148

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Library/Foundation/NSBundle+FileResource.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public extension NSBundle {
1717
- returns: The file URL for the resource file (R.file.*) or nil if the file could not be located.
1818
*/
1919
public func URLForResource(resource: FileResourceType) -> NSURL? {
20-
return URLForResource(resource.name, withExtension: resource.pathExtension, subdirectory: nil, localization: nil)
20+
return URLForResource(resource.name, withExtension: resource.pathExtension)
2121
}
2222

2323
/**
@@ -28,6 +28,6 @@ public extension NSBundle {
2828
- returns: The full pathname for the resource file (R.file.*) or nil if the file could not be located.
2929
*/
3030
public func pathForResource(resource: FileResourceType) -> String? {
31-
return pathForResource(resource.name, ofType: resource.pathExtension, inDirectory: nil, forLocalization: nil)
31+
return pathForResource(resource.name, ofType: resource.pathExtension)
3232
}
3333
}

0 commit comments

Comments
 (0)