<!--
{
  "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/CollectionTaskState",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "StoreKit",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:8StoreKit7ProductV01_aB8_SwiftUIE19CollectionTaskStateO"
  },
  "title" : "Product.CollectionTaskState"
}
-->

# Product.CollectionTaskState

The state of a task that loads a collection of products in the background.

```
enum CollectionTaskState
```

## Topics

### Collection task states

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

The task is loading the collection in the background.

[`case success([Product], unavailable: [Product.ID])`](/documentation/StoreKit/Product/CollectionTaskState/success(_:unavailable:))

The task completed loading the collection.

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

The task failed with an error.

### Instance Properties

[`var products: [Product]?`](/documentation/StoreKit/Product/CollectionTaskState/products)

An array of available products 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)