Structures
The following structures are available globally.
-
Configuration options for click event capture.
When enabled, a
$mp_clickevent is tracked for every tap on any element. Each event includes the touch coordinates, element identifier, class name, semantic role, and view hierarchy path. Accessibility labels are never captured: they are localized and can carry user data.See moreWarning
Experimental (beta). Autocapture may contain issues, and its API and the properties it captures may change in a future release before general availability. Pin your SDK version if you build reports on autocaptured events.Declaration
Swift
public struct ClickOptions
-
Configuration options for rage click detection.
Rage clicks are detected when a user taps rapidly multiple times in the same area, indicating frustration with an unresponsive element.
See moreWarning
Experimental (beta). Autocapture may contain issues, and its API and the properties it captures may change in a future release before general availability. Pin your SDK version if you build reports on autocaptured events.Declaration
Swift
public struct RageClickOptions
-
Configuration options for dead click detection.
Dead clicks are detected when a user taps on an interactive element but no visible UI change occurs, indicating a broken or unresponsive element.
See moreWarning
Experimental (beta). Autocapture may contain issues, and its API and the properties it captures may change in a future release before general availability. Pin your SDK version if you build reports on autocaptured events.Declaration
Swift
public struct DeadClickOptions
-
Configuration options for automatic event capture (clicks, rage clicks, dead clicks).
Autocapture is disabled by default and must be explicitly enabled by providing
AutocaptureOptionsduring SDK initialization.Example - Enable with defaults:
let options = MixpanelOptions( token: "YOUR_TOKEN", autocaptureOptions: AutocaptureOptions() )Example - Custom configuration:
let autocaptureOpts = AutocaptureOptions( clickOptions: ClickOptions(enabled: true), rageClickOptions: RageClickOptions( enabled: true, clickThreshold: 5, // Require 5 clicks instead of 4 timeWindowMs: 800 // Shorter time window ), deadClickOptions: DeadClickOptions( enabled: false // Disable dead click detection ) ) let options = MixpanelOptions( token: "YOUR_TOKEN", autocaptureOptions: autocaptureOpts )Platform support: iOS only. Mac Catalyst builds accept these options so shared iOS sources keep compiling, but automatic capture never starts there.
See moreWarning
Experimental (beta). Autocapture may contain issues, and its API and the properties it captures may change in a future release before general availability. Pin your SDK version if you build reports on autocaptured events.Declaration
Swift
public struct AutocaptureOptions -
Represents a captured click event with element metadata.
Contains all semantic information about the clicked element and its context. Create a
ClickEventand pass it tomixpanel.autocapture.trackClick(_:)to track click events with full element metadata. All stored properties are value types (CGFloat,String,Bool), so the event can safely cross threads — it is handed from the main thread, where it is extracted, to the queue that emits it.See moreWarning
Experimental (beta). Autocapture may contain issues, and its API and the properties it captures may change in a future release before general availability. Pin your SDK version if you build reports on autocaptured events.Declaration
Swift
public struct ClickEvent : Sendable
-
Undocumented
See moreDeclaration
Swift
public struct MixpanelFlagVariant : Decodable -
Undocumented
See moreDeclaration
Swift
public struct ProxyServerConfig -
This holds all the data for each log message, since the formatting is up to each logging object. It is a simple bag of data
See moreDeclaration
Swift
public struct MixpanelLogMessage -
Configuration options for feature flags behavior.
Use this to control how and when feature flags are loaded by the SDK.
Example — Default behavior (prefetches flags during initialization):
let options = MixpanelOptions( token: "YOUR_TOKEN", featureFlagOptions: FeatureFlagOptions(enabled: true) )Example — Deferred loading (for use with identify):
let options = MixpanelOptions( token: "YOUR_TOKEN", featureFlagOptions: FeatureFlagOptions(enabled: true, prefetchFlags: false) ) let mp = Mixpanel.initialize(options: options) // identify() triggers loadFlags() internally when the distinctId changes mp.identify(distinctId: "user123")If
See moreidentifymay be called with the same persisted distinctId (no change), callmp.flags.loadFlags()explicitly to ensure flags are fetched.Declaration
Swift
public struct FeatureFlagOptions -
Undocumented
See moreDeclaration
Swift
public struct ServerProxyResource
View on GitHub
Structures Reference