<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/URLSessionTask/State-swift.enum/completed",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@E@NSURLSessionTaskState@NSURLSessionTaskStateCompleted"
  },
  "title" : "URLSessionTask.State.completed"
}
-->

# URLSessionTask.State.completed

The task has completed (without being canceled), and the task’s delegate receives no further callbacks.

```
case completed
```

## Discussion

If the task completed successfully, the task’s [`error`](/documentation/Foundation/URLSessionTask/error) property is `nil`. Otherwise, it provides an error object that tells what went wrong. A task in this state is not subject to timeouts.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)