<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "os",
  "identifier" : "/documentation/os/os_activity_flag_t/OS_ACTIVITY_FLAG_DETACHED",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration Case",
  "symbol" : {
    "kind" : "Enumeration Case",
    "modules" : [
      "os"
    ],
    "preciseIdentifier" : "c:@EA@os_activity_flag_t@OS_ACTIVITY_FLAG_DETACHED"
  },
  "title" : "OS_ACTIVITY_FLAG_DETACHED"
}
-->

# OS_ACTIVITY_FLAG_DETACHED

Creates a new activity that is independent of any provided parent activity.

```
OS_ACTIVITY_FLAG_DETACHED
```

## Discussion

When you set this flag when creating an activity, the system creates the activity as a new top-level activity. If you provided a parent activity, the new activity notes this fact, allowing you to see which activity triggered the new activity without actually relating the activities.

Don’t pass [`OS_ACTIVITY_FLAG_DETACHED`](/documentation/os/os_activity_flag_t/OS_ACTIVITY_FLAG_DETACHED) and [`OS_ACTIVITY_FLAG_IF_NONE_PRESENT`](/documentation/os/os_activity_flag_t/OS_ACTIVITY_FLAG_IF_NONE_PRESENT) at the same time.

---

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)