This is an example Swift application that uses the iOS SDK for Harness Feature Flags.
This application will demonstrate the following:
- Connects to the Harness Feature Flags service via the CfClient
- Creates an Event Stream to get updates from the Cloud service
- Queries a Multivariate String feature flag and prints the value to the screen. This value will update if a change is made on the Harness Feature Flags dashboard.
- Xcode installed
- Cocoapods
gem install cocoapods
- Ensure you have a Harness Feature Flags project and environment set up.
- Generate a Client SDK Key
- Add the newly generated Client SDK Key to FeatureFlagsHelper.swift
private let apiKey = "enter client sdk key here"
For more information, refer to the Getting Started Guide
- Install dependencies via Cocoapods
pod install
- Open
ff-ios-sample.xcworkspace
in Xcode - Copy the feature flag key from your Harness Feature Flags Environment and set
apiKey
inFeatureFlagsHelper.swift
- Run your application through Xcode.