<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "XPC",
  "identifier" : "/documentation/XPC/xpc_activity_state_t",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "XPC"
    ],
    "preciseIdentifier" : "c:@T@xpc_activity_state_t"
  },
  "title" : "xpc_activity_state_t"
}
-->

# xpc_activity_state_t

A type that represents the state of an activity.

```
typealias xpc_activity_state_t = Int
```

## Discussion

An activity is in one of the states that [`xpc_activity_state_t`](/documentation/XPC/xpc_activity_state_t) defines. Apps may check the current state of the activity using [`xpc_activity_get_state(_:)`](/documentation/XPC/xpc_activity_get_state(_:)) in the handler block that you provide to [`xpc_activity_register(_:_:_:)`](/documentation/XPC/xpc_activity_register(_:_:_:)).

The app can modify the state of the activity by calling [`xpc_activity_set_state(_:_:)`](/documentation/XPC/xpc_activity_set_state(_:_:)) with one of the following:

- [`XPC_ACTIVITY_STATE_DEFER`](/documentation/XPC/XPC_ACTIVITY_STATE_DEFER)
- [`XPC_ACTIVITY_STATE_CONTINUE`](/documentation/XPC/XPC_ACTIVITY_STATE_CONTINUE)
- [`XPC_ACTIVITY_STATE_DONE`](/documentation/XPC/XPC_ACTIVITY_STATE_DONE)

---

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)