-
Notifications
You must be signed in to change notification settings - Fork 0
running features
Features are resolved through variations of relevant experiences. When you run a feature, the SDK finds all experiences whose variations include a fullStackFeature change linked to that feature, evaluates targeting rules, buckets the visitor, and returns the resolved feature status and variable values. See the data model for the full resolution chain.
Returns a single feature's status and variable values for the current visitor.
// Non-optional by contract: a miss or not-ready visitor yields a disabled Feature, never nil.
let feature = await context.runFeature("feature-key")
if feature.status == .enabled {
// resolve variables…
}Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| featureKey | string | Yes | The feature's unique key |
| attributes | object | No | Bucketing attributes (see creating a user context for the full attributes reference), plus: |
typeCasting (boolean) -- auto-convert values to the variable's defined type (default: true) |
|||
experienceKeys (string[]) -- limit evaluation to specific experiences only |
Returns all features with their status and variable values for the current visitor.
let features = await context.runFeatures()
for feature in features where feature.status == .enabled {
print("enabled:", feature.key)
}Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| attributes | object | No | Bucketing attributes (see creating a user context for the full attributes reference), plus typeCasting (boolean, default: true) |
Returns: An array of BucketedFeature objects.
Each resolved feature is returned as a BucketedFeature with the following fields:
| Field | Type | Description |
|---|---|---|
featureId |
string | The feature ID |
featureKey |
string | The feature key |
status |
string / FeatureStatus |
"enabled" or "disabled" (PHP uses the FeatureStatus enum) |
variables |
object / array | The feature variables with their resolved values |
End-to-end flow: initialize the SDK, create a user context, run a feature, and check its status and variables.
import ConvertSwiftSDK
let sdk = ConvertSwiftSDK(configuration: ConvertConfiguration(sdkKey: "your-sdk-key"))
try await sdk.ready()
let context = sdk.createContext(visitorId: "user-unique-id")
let feature = await context.runFeature("feature-key")
if feature.status == .enabled {
// Typed accessor — returns nil on key miss or type mismatch:
let ctaColor = feature.variable("ctaColor", as: String.self) ?? "#0066ff"
}Copyrights © 2026 All Rights Reserved by Convert Insights, Inc.
Getting Started
iOS SDK
- Quickstart
- Installation
- Initialization
- Configuration
- Return Types & Models
- Code Examples
- Offline Behavior
- Tracking Control
- App Privacy & Data Collection
- Objective-C Interop
Core Concepts
- Experiences & Variations
- Feature Flags
- Bucketing Algorithm
- Rule Evaluation
- Segments
- Data Management
- Event System
- API Communication
How-To Guides
- Running Experiences
- Running Features
- Tracking Conversions
- Visitor Context
- Persistent Storage
- Troubleshooting
- Direct Tracking Endpoint
- QA & Preview
- Mutually Exclusive Experiments
Contributing