<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "StoreKit",
  "identifier" : "/documentation/StoreKit/Product/TaskState",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "StoreKit",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:8StoreKit7ProductV01_aB8_SwiftUIE9TaskStateO"
  },
  "title" : "Product.TaskState"
}
-->

# Product.TaskState

The state of a task that loads a product in the background.

```
enum TaskState
```

## Topics

### Task states

[`case loading`](/documentation/StoreKit/Product/TaskState/loading)

The task is loading the product in the background.

[`case success(Product)`](/documentation/StoreKit/Product/TaskState/success(_:))

The task successfully loaded the product.

[`case unavailable`](/documentation/StoreKit/Product/TaskState/unavailable)

The product is unavailable in the current storefront.

[`case failure(any Error)`](/documentation/StoreKit/Product/TaskState/failure(_:))

The task failed with an error.

### Instance Properties

[`var product: Product?`](/documentation/StoreKit/Product/TaskState/product)

The product value if the task was successful.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

---

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)