Skip to content

Commit 39a0279

Browse files
committed
Update NSString.path(withComponents:) API
This update is to match Darwin
1 parent b1f31ab commit 39a0279

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
@@ -199,7 +199,7 @@ extension NSString {
199199
#endif
200200
}
201201

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

Foundation/NSURL.swift

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

0 commit comments

Comments
 (0)