Преглед на файлове

Fixes bugs in examples (#1997)

`URL.appendPathComponent` is mutating; the example is set up to use the generating version `URL.appendingPathComponent`.
Raphael R преди 8 години
родител
ревизия
89c0a7617e
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      README.md

+ 2 - 2
README.md

@@ -630,7 +630,7 @@ You can also provide a `DownloadFileDestination` closure to move the file from t
 ```swift
 let destination: DownloadRequest.DownloadFileDestination = { _, _ in
 	let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
-	let fileURL = documentsURL.appendPathComponent("pig.png")
+	let fileURL = documentsURL.appendingPathComponent("pig.png")
 
     return (fileURL, [.removePreviousFile, .createIntermediateDirectories])
 }
@@ -699,7 +699,7 @@ class ImageRequestor {
 
 		let destination: DownloadRequest.DownloadFileDestination = { _, _ in
 			let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
-			let fileURL = documentsURL.appendPathComponent("pig.png")
+			let fileURL = documentsURL.appendingPathComponent("pig.png")
 
 		    return (fileURL, [.removePreviousFile, .createIntermediateDirectories])
 		}