# PostHog iOS SDK

**SDK Version:** 3.34.0

PostHog iOS SDK allows you to automatically capture usage and send events to PostHog from iOS applications.

## Categories

- Initialization
- Identification
- Capture
- Feature flags
- Session replay
- Privacy
- Configuration

## PostHogSDK

The PostHogSDK class

### Identification methods

#### alias()

**Release Tag:** public

alias method

### Parameters

- **`alias`** (`String`) - The alias parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.alias(alias: "alias_value")
```

---

#### getAnonymousId()

**Release Tag:** public

getAnonymousId method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.getAnonymousId()
```

---

#### getDistinctId()

**Release Tag:** public

getDistinctId method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.getDistinctId()
```

---

#### identify()

**Release Tag:** public

identify method

### Parameters

- **`distinctId`** (`String`) - The distinctId parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.identify(distinctId: "distinctId_value")
```

---

#### identify()

**Release Tag:** public

identify method

### Parameters

- **`distinctId`** (`String`) - The distinctId parameter
- **`userProperties`** (`String`) - The userProperties parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.identify(distinctId: "distinctId_value", userProperties: "userProperties_value")
```

---

#### identify()

**Release Tag:** public

identify method

### Parameters

- **`distinctId`** (`String`) - The distinctId parameter
- **`userProperties`** (`String`) - The userProperties parameter
- **`userPropertiesSetOnce`** (`String`) - The userPropertiesSetOnce parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.identify(distinctId: "distinctId_value", userProperties: "userProperties_value", userPropertiesSetOnce: "userPropertiesSetOnce_value")
```

---

### Capture methods

#### capture()

**Release Tag:** public

capture method

### Parameters

- **`event`** (`String`) - The event parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.capture(event: "event_value")
```

---

#### capture()

**Release Tag:** public

capture method

### Parameters

- **`event`** (`String`) - The event parameter
- **`distinctId`** (`String`) - The distinctId parameter
- **`properties`** (`String`) - The properties parameter
- **`userProperties`** (`String`) - The userProperties parameter
- **`userPropertiesSetOnce`** (`String`) - The userPropertiesSetOnce parameter
- **`groups`** (`String`) - The groups parameter
- **`properties`** (`String`) - The properties parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.capture(event: "event_value", distinctId: "distinctId_value", properties: "properties_value", userProperties: "userProperties_value", userPropertiesSetOnce: "userPropertiesSetOnce_value", groups: "groups_value", properties: "properties_value")
```

---

#### capture()

**Release Tag:** public

capture method

### Parameters

- **`event`** (`String`) - The event parameter
- **`distinctId`** (`String`) - The distinctId parameter
- **`properties`** (`String`) - The properties parameter
- **`userProperties`** (`String`) - The userProperties parameter
- **`userPropertiesSetOnce`** (`String`) - The userPropertiesSetOnce parameter
- **`groups`** (`String`) - The groups parameter
- **`properties`** (`String`) - The properties parameter
- **`timestamp`** (`Date`) - The timestamp parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.capture(event: "event_value", distinctId: "distinctId_value", properties: "properties_value", userProperties: "userProperties_value", userPropertiesSetOnce: "userPropertiesSetOnce_value", groups: "groups_value", properties: "properties_value", timestamp: "timestamp_value")
```

---

#### capture()

**Release Tag:** public

capture method

### Parameters

- **`event`** (`String`) - The event parameter
- **`properties`** (`String`) - The properties parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.capture(event: "event_value", properties: "properties_value")
```

---

#### capture()

**Release Tag:** public

capture method

### Parameters

- **`event`** (`String`) - The event parameter
- **`properties`** (`String`) - The properties parameter
- **`userProperties`** (`String`) - The userProperties parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.capture(event: "event_value", properties: "properties_value", userProperties: "userProperties_value")
```

---

#### capture()

**Release Tag:** public

capture method

### Parameters

- **`event`** (`String`) - The event parameter
- **`properties`** (`String`) - The properties parameter
- **`userProperties`** (`String`) - The userProperties parameter
- **`userPropertiesSetOnce`** (`String`) - The userPropertiesSetOnce parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.capture(event: "event_value", properties: "properties_value", userProperties: "userProperties_value", userPropertiesSetOnce: "userPropertiesSetOnce_value")
```

---

#### capture()

**Release Tag:** public

capture method

### Parameters

- **`event`** (`String`) - The event parameter
- **`properties`** (`String`) - The properties parameter
- **`userProperties`** (`String`) - The userProperties parameter
- **`userPropertiesSetOnce`** (`String`) - The userPropertiesSetOnce parameter
- **`groups`** (`String`) - The groups parameter
- **`properties`** (`String`) - The properties parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.capture(event: "event_value", properties: "properties_value", userProperties: "userProperties_value", userPropertiesSetOnce: "userPropertiesSetOnce_value", groups: "groups_value", properties: "properties_value")
```

---

#### flush()

**Release Tag:** public

flush method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.flush()
```

---

#### register()

**Release Tag:** public

register method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.register()
```

---

#### screen()

**Release Tag:** public

screen method

### Parameters

- **`name`** (`String`) - The name parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.screen(name: "name_value")
```

---

#### screen()

**Release Tag:** public

screen method

### Parameters

- **`name`** (`String`) - The name parameter
- **`properties`** (`String`) - The properties parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.screen(name: "name_value", properties: "properties_value")
```

---

#### unregister()

**Release Tag:** public

unregister method

### Parameters

- **`param0`** (`String`) - The param0 parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.unregister(param0: "param0_value")
```

---

### Configuration methods

#### close()

**Release Tag:** public

close method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.close()
```

---

#### debug()

**Release Tag:** public

debug method

### Parameters

- **`param0`** (`Bool`) - The param0 parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.debug(param0: true)
```

---

#### group()

**Release Tag:** public

group method

### Parameters

- **`type`** (`String`) - The type parameter
- **`key`** (`String`) - The key parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.group(type: "type_value", key: "key_value")
```

---

#### group()

**Release Tag:** public

group method

### Parameters

- **`type`** (`String`) - The type parameter
- **`key`** (`String`) - The key parameter
- **`groupProperties`** (`String`) - The groupProperties parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.group(type: "type_value", key: "key_value", groupProperties: "groupProperties_value")
```

---

#### didStartNotification()

**Release Tag:** public

didStartNotification method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.didStartNotification()
```

---

#### shared()

**Release Tag:** public

shared method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.shared()
```

---

### Session replay methods

#### endSession()

**Release Tag:** public

endSession method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.endSession()
```

---

#### getSessionId()

**Release Tag:** public

getSessionId method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.getSessionId()
```

---

#### startSession()

**Release Tag:** public

startSession method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.startSession()
```

---

### Feature flags methods

#### getFeatureFlag()

**Release Tag:** public

getFeatureFlag method

### Parameters

- **`param0`** (`String`) - The param0 parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.getFeatureFlag(param0: "param0_value")
```

---

#### getFeatureFlagPayload()

**Release Tag:** public

getFeatureFlagPayload method

### Parameters

- **`param0`** (`String`) - The param0 parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.getFeatureFlagPayload(param0: "param0_value")
```

---

#### isFeatureEnabled()

**Release Tag:** public

isFeatureEnabled method

### Parameters

- **`param0`** (`String`) - The param0 parameter
- **`param1`** (`Bool`) - The param1 parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.isFeatureEnabled(param0: "param0_value", param1: true)
```

---

#### reloadFeatureFlags()

**Release Tag:** public

reloadFeatureFlags method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.reloadFeatureFlags()
```

---

#### reloadFeatureFlags()

**Release Tag:** public

reloadFeatureFlags method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.reloadFeatureFlags()
```

---

#### resetGroupPropertiesForFlags()

**Release Tag:** public

Clears all group properties for feature flag evaluation.

**Notes:**

Clears all group properties for feature flag evaluation.

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.resetGroupPropertiesForFlags()
```

---

#### resetGroupPropertiesForFlags()

**Release Tag:** public

Clears group properties for feature flag evaluation for a specific group type.

**Notes:**

Clears group properties for feature flag evaluation for a specific group type.

### Parameters

- **`groupType`** (`Any`) - The group type to clear properties for

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.resetGroupPropertiesForFlags(groupType: "groupType_value")
```

---

#### resetPersonPropertiesForFlags()

**Release Tag:** public

Resets all person properties that were set for feature flag evaluation.

**Notes:**

After calling this method, feature flag evaluation will only use server-side person properties   and will not include any locally overridden properties.

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.resetPersonPropertiesForFlags()
```

---

#### setGroupPropertiesForFlags()

**Release Tag:** public

Sets properties for a specific group type to include when evaluating feature flags.   These properties supplement the standard group information sent to PostHog for flag evaluation,   providing additional context that can be used in flag targeting conditions.

**Notes:**

Sets properties for a specific group type to include when evaluating feature flags.   These properties supplement the standard group information sent to PostHog for flag evaluation,   providing additional context that can be used in flag targeting conditions.

### Parameters

- **`groupType`** (`Any`) - The group type identifier (e.g., “organization”, “team”)
- **`properties`** (`String`) - Dictionary of properties to set for this group type

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.setGroupPropertiesForFlags(groupType: "groupType_value", properties: "properties_value")
```

---

#### setGroupPropertiesForFlags()

**Release Tag:** public

Sets properties for a specific group type to include when evaluating feature flags.   These properties supplement the standard group information sent to PostHog for flag evaluation,   providing additional context that can be used in flag targeting conditions.

**Notes:**

Sets properties for a specific group type to include when evaluating feature flags.   These properties supplement the standard group information sent to PostHog for flag evaluation,   providing additional context that can be used in flag targeting conditions.

### Parameters

- **`groupType`** (`Any`) - The group type identifier (e.g., “organization”, “team”)
- **`properties`** (`String`) - Dictionary of properties to set for this group type
- **`reloadFeatureFlags`** (`Bool`) - Whether to automatically reload feature flags after setting properties

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.setGroupPropertiesForFlags(groupType: "groupType_value", properties: "properties_value", reloadFeatureFlags: true)
```

---

#### setPersonPropertiesForFlags()

**Release Tag:** public

Sets person properties that will be included in feature flag evaluation requests.

**Notes:**

This method allows you to override server-side person properties for immediate feature flag evaluation,   solving the race condition where person properties from   calls may not have been processed   by the server yet. Properties are merged additively with existing properties. Feature flags are automatically reloaded   after setting properties.

### Parameters

- **`properties`** (`Any`) - Dictionary of person properties to include in flag evaluation

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.setPersonPropertiesForFlags(properties: "properties_value")
```

---

#### setPersonPropertiesForFlags()

**Release Tag:** public

Sets person properties that will be included in feature flag evaluation requests.

**Notes:**

This method allows you to override server-side person properties for immediate feature flag evaluation,   solving the race condition where person properties from   calls may not have been processed   by the server yet. Properties are merged additively with existing properties.

### Parameters

- **`properties`** (`Any`) - Dictionary of person properties to include in flag evaluation
- **`reloadFeatureFlags`** (`Bool`) - Whether to automatically reload feature flags after setting properties

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.setPersonPropertiesForFlags(properties: "properties_value", reloadFeatureFlags: true)
```

---

#### didReceiveFeatureFlags()

**Release Tag:** public

didReceiveFeatureFlags method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.didReceiveFeatureFlags()
```

---

### Privacy methods

#### isOptOut()

**Release Tag:** public

isOptOut method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.isOptOut()
```

---

#### optIn()

**Release Tag:** public

optIn method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.optIn()
```

---

#### optOut()

**Release Tag:** public

optOut method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.optOut()
```

---

#### reset()

**Release Tag:** public

reset method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.reset()
```

---

### Initialization methods

#### setup()

**Release Tag:** public

setup method

### Parameters

- **`param0`** (`PostHogConfig`) - The param0 parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.setup(param0: "param0_value")
```

---

#### with()

**Release Tag:** public

with method

### Parameters

- **`param0`** (`PostHogConfig`) - The param0 parameter
- **`param1`** (`PostHogSDK`) - The param1 parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.with(param0: "param0_value", param1: "param1_value")
```

---

## PostHogDisplaySurvey

A model representing a PostHog survey to be displayed to users

### Configuration methods

#### appearance()

**Release Tag:** public

Optional appearance configuration for customizing the survey’s look and feel

**Notes:**

Optional appearance configuration for customizing the survey’s look and feel

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.appearance()
```

---

#### endDate()

**Release Tag:** public

Optional date indicating when the survey should stop being shown

**Notes:**

Optional date indicating when the survey should stop being shown

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.endDate()
```

---

#### id()

**Release Tag:** public

Unique identifier for the survey

**Notes:**

Unique identifier for the survey

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.id()
```

---

#### name()

**Release Tag:** public

Name of the survey

**Notes:**

Name of the survey

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.name()
```

---

#### questions()

**Release Tag:** public

Array of questions to be presented in the survey

**Notes:**

Array of questions to be presented in the survey

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.questions()
```

---

#### startDate()

**Release Tag:** public

Optional date indicating when the survey should start being shown

**Notes:**

Optional date indicating when the survey should start being shown

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.startDate()
```

---

## PostHogDisplayLinkQuestion

Represents a question with a clickable link

### Configuration methods

#### link()

**Release Tag:** public

The URL that will be opened when the link is clicked

**Notes:**

The URL that will be opened when the link is clicked

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.link()
```

---

## PostHogDisplayChoiceQuestion

Represents a multiple or single choice question where users can select one or more options

### Configuration methods

#### choices()

**Release Tag:** public

The list of options for the user to choose from

**Notes:**

The list of options for the user to choose from

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.choices()
```

---

#### hasOpenChoice()

**Release Tag:** public

Whether the question includes an “other” option for users to input free-form text

**Notes:**

Whether the question includes an “other” option for users to input free-form text

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.hasOpenChoice()
```

---

#### isMultipleChoice()

**Release Tag:** public

Whether the user can select multiple options

**Notes:**

Whether the user can select multiple options

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.isMultipleChoice()
```

---

#### shuffleOptions()

**Release Tag:** public

Whether the options should be shuffled to randomize the order

**Notes:**

Whether the options should be shuffled to randomize the order

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.shuffleOptions()
```

---

## PostHogNextSurveyQuestion

A model representing the next state of the survey progression.

### Configuration methods

#### isSurveyCompleted()

**Release Tag:** public

Whether all questions have been answered and the survey is complete   Depending on the survey appearance configuration, you may want to show the “Thank you” message or dismiss the survey at this point

**Notes:**

Whether all questions have been answered and the survey is complete   Depending on the survey appearance configuration, you may want to show the “Thank you” message or dismiss the survey at this point

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.isSurveyCompleted()
```

---

#### questionIndex()

**Release Tag:** public

The index of the next question to be displayed (0-based)

**Notes:**

The index of the next question to be displayed (0-based)

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.questionIndex()
```

---

## PostHogStorageManager

The PostHogStorageManager class

### Identification methods

#### getAnonymousId()

**Release Tag:** public

getAnonymousId method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.getAnonymousId()
```

---

#### getDistinctId()

**Release Tag:** public

getDistinctId method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.getDistinctId()
```

---

### Configuration methods

#### isIdentified()

**Release Tag:** public

isIdentified method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.isIdentified()
```

---

#### isPersonProcessing()

**Release Tag:** public

isPersonProcessing method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.isPersonProcessing()
```

---

#### setAnonymousId()

**Release Tag:** public

setAnonymousId method

### Parameters

- **`param0`** (`String`) - The param0 parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.setAnonymousId(param0: "param0_value")
```

---

#### setDistinctId()

**Release Tag:** public

setDistinctId method

### Parameters

- **`param0`** (`String`) - The param0 parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.setDistinctId(param0: "param0_value")
```

---

#### setIdentified()

**Release Tag:** public

setIdentified method

### Parameters

- **`param0`** (`Bool`) - The param0 parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.setIdentified(param0: true)
```

---

#### setPersonProcessing()

**Release Tag:** public

setPersonProcessing method

### Parameters

- **`param0`** (`Bool`) - The param0 parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.setPersonProcessing(param0: true)
```

---

### Privacy methods

#### reset()

**Release Tag:** public

reset method

### Parameters

- **`keepAnonymousId`** (`Bool`) - The keepAnonymousId parameter
- **`param1`** (`Bool`) - The param1 parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.reset(keepAnonymousId: true, param1: true)
```

---

## PostHogDisplayOpenQuestion

Represents an open-ended question where users can input free-form text

## PostHogEvent

The PostHogEvent class

### Configuration methods

#### distinctId()

**Release Tag:** public

distinctId method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.distinctId()
```

---

#### event()

**Release Tag:** public

event method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.event()
```

---

#### properties()

**Release Tag:** public

properties method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.properties()
```

---

#### timestamp()

**Release Tag:** public

timestamp method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.timestamp()
```

---

#### uuid()

**Release Tag:** public

uuid method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.uuid()
```

---

## PostHogSurveyResponse

A model representing a user’s response to a survey question

### Configuration methods

#### linkClicked()

**Release Tag:** public

Whether a link was clicked (for link questions)

**Notes:**

Whether a link was clicked (for link questions)

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.linkClicked()
```

---

#### ratingValue()

**Release Tag:** public

The numeric rating value (for rating questions)

**Notes:**

The numeric rating value (for rating questions)

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.ratingValue()
```

---

#### selectedOptions()

**Release Tag:** public

The selected options (for multiple or single choice questions)

**Notes:**

The selected options (for multiple or single choice questions)

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.selectedOptions()
```

---

#### textValue()

**Release Tag:** public

The text response (for open questions)

**Notes:**

The text response (for open questions)

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.textValue()
```

---

#### type()

**Release Tag:** public

The type of response (link, rating, text, or multiple choice)

**Notes:**

The type of response (link, rating, text, or multiple choice)

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.type()
```

---

#### link()

**Release Tag:** public

Creates a response for a link question

**Notes:**

Creates a response for a link question

### Parameters

- **`clicked`** (`Any`) - Whether the link was clicked

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.link(clicked: "clicked_value")
```

---

#### multipleChoice()

**Release Tag:** public

Creates a response for a multiple-choice question

**Notes:**

Creates a response for a multiple-choice question

### Parameters

- **`multipleChoice`** (`Any`) - The selected options

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.multipleChoice(multipleChoice: "multipleChoice_value")
```

---

#### openEnded()

**Release Tag:** public

Creates a response for an open-ended question

**Notes:**

Creates a response for an open-ended question

### Parameters

- **`openEnded`** (`Any`) - The text response

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.openEnded(openEnded: "openEnded_value")
```

---

#### rating()

**Release Tag:** public

Creates a response for a rating question

**Notes:**

Creates a response for a rating question

### Parameters

- **`rating`** (`Any`) - The selected rating value

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.rating(rating: "rating_value")
```

---

#### singleChoice()

**Release Tag:** public

Creates a response for a single-choice question

**Notes:**

Creates a response for a single-choice question

### Parameters

- **`singleChoice`** (`Any`) - The selected option

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.singleChoice(singleChoice: "singleChoice_value")
```

---

## PostHogDisplaySurveyQuestion

Base class for all survey question types

### Configuration methods

#### buttonText()

**Release Tag:** public

Optional custom text for the question’s action button

**Notes:**

Optional custom text for the question’s action button

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.buttonText()
```

---

#### id()

**Release Tag:** public

The question ID, empty if none

**Notes:**

The question ID, empty if none

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.id()
```

---

#### isOptional()

**Release Tag:** public

Whether the question can be skipped

**Notes:**

Whether the question can be skipped

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.isOptional()
```

---

#### question()

**Release Tag:** public

The main question text to display

**Notes:**

The main question text to display

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.question()
```

---

#### questionDescription()

**Release Tag:** public

Optional additional description or context for the question

**Notes:**

Optional additional description or context for the question

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.questionDescription()
```

---

#### questionDescriptionContentType()

**Release Tag:** public

Content type for the question description (HTML or plain text)

**Notes:**

Content type for the question description (HTML or plain text)

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.questionDescriptionContentType()
```

---

## PostHogSessionManager

The PostHogSessionManager class

### Session replay methods

#### setSessionId()

**Release Tag:** public

setSessionId method

### Parameters

- **`param0`** (`String`) - The param0 parameter

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.setSessionId(param0: "param0_value")
```

---

### Configuration methods

#### shared()

**Release Tag:** public

shared method

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.shared()
```

---

## PostHogSurveysConfig

The PostHogSurveysConfig class

### Configuration methods

#### surveysDelegate()

**Release Tag:** public

Delegate responsible for managing survey presentation in your app.   Handles survey rendering, response collection, and lifecycle events.   You can provide your own delegate for a custom survey presentation.

**Notes:**

Defaults to   which provides a standard survey UI.

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.surveysDelegate()
```

---

## PostHogDisplayRatingQuestion

Represents a rating question where users can select a rating from a scale

### Configuration methods

#### lowerBoundLabel()

**Release Tag:** public

The label for the lower bound of the rating scale

**Notes:**

The label for the lower bound of the rating scale

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.lowerBoundLabel()
```

---

#### ratingType()

**Release Tag:** public

The type of rating scale (numbers, emoji)

**Notes:**

The type of rating scale (numbers, emoji)

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.ratingType()
```

---

#### scaleLowerBound()

**Release Tag:** public

The lower bound of the rating scale

**Notes:**

The lower bound of the rating scale

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.scaleLowerBound()
```

---

#### scaleUpperBound()

**Release Tag:** public

The upper bound of the rating scale

**Notes:**

The upper bound of the rating scale

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.scaleUpperBound()
```

---

#### upperBoundLabel()

**Release Tag:** public

The label for the upper bound of the rating scale

**Notes:**

The label for the upper bound of the rating scale

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.upperBoundLabel()
```

---

## PostHogDisplaySurveyAppearance

Model that describes the appearance customization of a PostHog survey

### Configuration methods

#### backgroundColor()

**Release Tag:** public

Optional background color as web color (e.g. “#FFFFFF” or “white”)

**Notes:**

Optional background color as web color (e.g. “#FFFFFF” or “white”)

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.backgroundColor()
```

---

#### borderColor()

**Release Tag:** public

Optional border color as web color

**Notes:**

Optional border color as web color

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.borderColor()
```

---

#### descriptionTextColor()

**Release Tag:** public

Optional color for description text as web color

**Notes:**

Optional color for description text as web color

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.descriptionTextColor()
```

---

#### displayThankYouMessage()

**Release Tag:** public

Whether to show a thank you message after survey completion

**Notes:**

Whether to show a thank you message after survey completion

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.displayThankYouMessage()
```

---

#### fontFamily()

**Release Tag:** public

Optional font family to use throughout the survey

**Notes:**

Optional font family to use throughout the survey

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.fontFamily()
```

---

#### placeholder()

**Release Tag:** public

Optional placeholder text for input fields

**Notes:**

Optional placeholder text for input fields

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.placeholder()
```

---

#### ratingButtonActiveColor()

**Release Tag:** public

Optional color for active/selected rating buttons as web color

**Notes:**

Optional color for active/selected rating buttons as web color

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.ratingButtonActiveColor()
```

---

#### ratingButtonColor()

**Release Tag:** public

Optional color for rating buttons as web color

**Notes:**

Optional color for rating buttons as web color

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.ratingButtonColor()
```

---

#### submitButtonColor()

**Release Tag:** public

Optional background color for the submit button as web color

**Notes:**

Optional background color for the submit button as web color

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.submitButtonColor()
```

---

#### submitButtonText()

**Release Tag:** public

Optional custom text for the submit button

**Notes:**

Optional custom text for the submit button

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.submitButtonText()
```

---

#### submitButtonTextColor()

**Release Tag:** public

Optional text color for the submit button as web color

**Notes:**

Optional text color for the submit button as web color

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.submitButtonTextColor()
```

---

#### thankYouMessageCloseButtonText()

**Release Tag:** public

Optional text for the close button in the thank you message

**Notes:**

Optional text for the close button in the thank you message

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.thankYouMessageCloseButtonText()
```

---

#### thankYouMessageDescription()

**Release Tag:** public

Optional description text for the thank you message

**Notes:**

Optional description text for the thank you message

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.thankYouMessageDescription()
```

---

#### thankYouMessageDescriptionContentType()

**Release Tag:** public

Optional content type for the thank you message description

**Notes:**

Optional content type for the thank you message description

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.thankYouMessageDescriptionContentType()
```

---

#### thankYouMessageHeader()

**Release Tag:** public

Optional header text for the thank you message

**Notes:**

Optional header text for the thank you message

### Returns

- `Void`

### Examples

```swift
PostHogSDK.shared.thankYouMessageHeader()
```

---