---
title: state
framework: groupactivities
role: symbol
role_heading: Instance Property
path: groupactivities/groupsession/state-swift.property
---

# state

The current state of the session.

## Declaration

```swift
@Published<GroupSession<ActivityType>.State> final var state: GroupSession<ActivityType>.State { get }
```

## Discussion

Discussion Use this property to get the current state value, or configure a subscriber to detect changes to the value. To change the state of a session, call the join() and leave() methods. If a failure occurs or the session ends, the session object transitions to the GroupSession.State.invalidated(reason:)state. If the session ends because of an error, it provides information about that error.

## See Also

### Getting the session details

- [GroupSession.State](groupactivities/groupsession/state-swift.enum.md)
- [id](groupactivities/groupsession/id.md)
