Skip to content

Commit 6796e9b

Browse files
authored
Merge pull request #2290 from keith/ks/path-components-api
Update NSString.path(withComponents:) API
2 parents 98bf5c8 + 39a0279 commit 6796e9b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Foundation/NSPathUtilities.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ extension NSString {
197197
#endif
198198
}
199199

200-
public static func pathWithComponents(_ components: [String]) -> String {
200+
public static func path(withComponents components: [String]) -> String {
201201
var result = ""
202202
for comp in components.prefix(components.count - 1) {
203203
result = result._stringByAppendingPathComponent(comp._stringByFixingSlashes(), doneAppending: false)

Foundation/NSURL.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ extension NSURL {
880880
/* The following methods work on the path portion of a URL in the same manner that the NSPathUtilities methods on NSString do.
881881
*/
882882
open class func fileURL(withPathComponents components: [String]) -> URL? {
883-
let path = NSString.pathWithComponents(components)
883+
let path = NSString.path(withComponents: components)
884884
if components.last == "/" {
885885
return URL(fileURLWithPath: path, isDirectory: true)
886886
} else {

0 commit comments

Comments
 (0)