@@ -213,39 +213,39 @@ let uploadable = URL(...) // may also be Data or arrays of URL or Data.
213213
214214// Call the function in your `Client` instance that takes care of uploading your Uploadable.
215215// Please notice that most arguments have sensible defaults and may be ommited.
216- let mpu = client.upload (// You may pass an URL, Data or arrays of URL or Data
217- using : uploadable,
218- // Set the upload options here. If none given, `UploadOptions.defaults`
219- // is assumed.
220- options : uploadOptions,
221- // Set the dispatch queue where you want your upload progress
222- // and completion handlers to be called.
223- // Remember that any UI updates should be performed on the
224- // main queue.
225- // You can omit this parameter, and the main queue will be
226- // used by default.
227- queue : .main ,
228- // Set your upload progress handler here (optional)
229- uploadProgress : { progress in
230- // Here you may update the UI to reflect the upload progress.
231- print (" Progress: \( progress ) " )
232- }) { response in
233- // Try to obtain Filestack handle
234- if let json = response? .json, let handle = json[" handle" ] as? String {
235- // Use Filestack handle
236- } else if let error = response? .error {
237- // Handle error
238- }
239- }
216+ let uploader = client.upload (// You may pass an URL, Data or arrays of URL or Data
217+ using : uploadable,
218+ // Set the upload options here. If none given, `UploadOptions.defaults`
219+ // is assumed.
220+ options : uploadOptions,
221+ // Set the dispatch queue where you want your upload progress
222+ // and completion handlers to be called.
223+ // Remember that any UI updates should be performed on the
224+ // main queue.
225+ // You can omit this parameter, and the main queue will be
226+ // used by default.
227+ queue : .main ,
228+ // Set your upload progress handler here (optional)
229+ uploadProgress : { progress in
230+ // Here you may update the UI to reflect the upload progress.
231+ print (" Progress: \( progress ) " )
232+ }) { response in
233+ // Try to obtain Filestack handle
234+ if let json = response? .json, let handle = json[" handle" ] as? String {
235+ // Use Filestack handle
236+ } else if let error = response? .error {
237+ // Handle error
238+ }
239+ }
240240
241241// Start upload (only useful when `startImmediately` option is `false`)
242- mpu .start ()
242+ uploader .start ()
243243
244244// Cancel ongoing upload.
245- mpu .cancel ()
245+ uploader .cancel ()
246246
247247// Query progress.
248- mpu .progress // returns a `Progress` object
248+ uploader .progress // returns a `Progress` object
249249```
250250</ details>
251251
@@ -288,8 +288,8 @@ uploadOptions.storeOptions.workflows = @[@"WF-1", @"WF-2"];
288288// Some local URL to be uploaded
289289NSURL * someURL = ... ;
290290
291- FSMultipartUpload * mpu = [client uploadURLUsing: someURL
292- options: uploadOptions
291+ FSUploader * uploader = [client uploadURLUsing: someURL
292+ options: uploadOptions
293293 queue: dispatch_get_main_queue ()
294294 uploadProgress: ^ (NSProgress * _Nonnull progress) {
295295 // Here you may update the UI to reflect the upload progress.
@@ -316,13 +316,13 @@ FSMultipartUpload *mpu = [client uploadURLUsing:someURL
316316// - For multiple data uploading: `uploadMultipleDataUsing:options:queue:uploadProgress:completionHandler:)`
317317
318318// Start upload (only useful when `startImmediately` option is `false`)
319- [mpu start];
319+ [uploader start];
320320
321321// Cancel ongoing upload.
322- [mpu cancel];
322+ [uploader cancel];
323323
324324// Query progress.
325- mpu .progress // returns an `NSProgress` object
325+ uploader .progress // returns an `NSProgress` object
326326```
327327</ details>
328328</ details>
0 commit comments