From ec8edb06780afa2f0949d4129c7e6de1cf126291 Mon Sep 17 00:00:00 2001 From: Ceyhun Ozugur Date: Mon, 29 Aug 2016 21:14:04 +0300 Subject: [PATCH] Fix README for TaskCompletionSource.cancel() (#37) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8366533..df43f75 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ fetchProfile(user).continueOnSuccessWithTask { task in ## Creating Tasks To create a task - you would need a `TaskCompletionSource`, which is a consumer end of any `Task`, which gives you an ability to control whether the task is completed/faulted or cancelled. -After you create a `TaskCompletionSource`, you need to call `setResult()`/`setError()`/`setCancelled` to trigger its continuations and change its state. +After you create a `TaskCompletionSource`, you need to call `setResult()`/`setError()`/`cancel()` to trigger its continuations and change its state. ```swift func fetch(object: PFObject) -> Task { let taskCompletionSource = TaskCompletionSource() @@ -103,7 +103,7 @@ func fetch(object: PFObject) -> Task { } else if let object = object { taskCompletionSource.setResult(object) } else { - taskCompletionSource.setCancelled() + taskCompletionSource.cancel() } } return taskCompletionSource.task