An active participant in a group session.
Use a `Participant` object to differentiate among users in a session.
A participant object doesn't contain any sensitive data about the user,
but provides a unique identifier to distinguish the user while
the session is active.
You don't create participant objects directly. The system creates a
participant object for each user that joins an activity. Access
the current set of participants from the ``GroupSession/activeParticipants`` property of
the ``GroupSession`` object associated with the activity.
Members (3)
get · iOS 26.0+
isNearbyWithLocalParticipant
TypeScript
get isNearbyWithLocalParticipant(): boolean
Swift declaration
var isNearbyWithLocalParticipant: Bool { get }
A Boolean value that indicates whether the participant is physically
nearby with the local participant.
This property is always true for the local participant.
You can observe which remote participants are nearby with the
``GroupSession/$activeParticipants`` publisher.
```swift
for await activeParticipants in session.$activeParticipants.values {
// Ignore the local participant value that defaults to 'true'.
self.isNearbyWithOthers = activeParticipants.contains {
$0 != session.localParticipant && $0.isNearbyWithLocalParticipant
}
}
```
get
description
TypeScript
get description(): string
Swift declaration
var description: String { get }
A textual representation of this instance.
Calling this property directly is discouraged. Instead, convert an
instance of any type to a string by using the `String(describing:)`
initializer. This initializer works with any type, and uses the custom
`description` property for types that conform to
`CustomStringConvertible`:
struct Point: CustomStringConvertible {
let x: Int, y: Int
var description: String {
return "(\(x), \(y))"
}
}
let p = Point(x: 21, y: 30)
let s = String(describing: p)
print(s)
// Prints "(21, 30)"
The conversion of `p` to a string in the assignment to `s` uses the
`Point` type's `description` property.
get · iOS 15.0+
id
TypeScript
get id(): string
Swift declaration
let id: UUID
A globally unique identifier for the session participant.
Use this property to differentiate among the devices active in a session.