<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GroupActivities",
  "identifier" : "/documentation/GroupActivities/GroupActivityMetadata/LifetimePolicy-swift.struct/endsWhenInitiatorLeaves",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "Group Activities"
    ],
    "preciseIdentifier" : "s:15GroupActivities0A16ActivityMetadataV14LifetimePolicyV23endsWhenInitiatorLeavesAEvpZ"
  },
  "title" : "endsWhenInitiatorLeaves"
}
-->

# endsWhenInitiatorLeaves

The activity should end when the initiator of the activity leaves.

```
static let endsWhenInitiatorLeaves: GroupActivityMetadata.LifetimePolicy
```

## Discussion

This case should be used in the rare instances where the initiator of the activity
owns what is being shared; for example, activities that share photos or slides
that exclusively belong to the initiator of the activity would use this so that
when they leave the group session, the content will no longer be shared.

> Important: The majority of SharePlay apps should use the ``doc://com.apple.GroupActivities/documentation/GroupActivities/GroupActivityMetadata/LifetimePolicy-swift.struct/automatic`` policy, instead.

---

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)