Flipt iOS SDK
A native client SDK for Flipt, written in Swift for iOS apps.
Contents of this Readme
Flipt is available through CocoaPods. To install
it, simply add the following line to your Podfile:
Flipt is available through Carthage. To install
it, simply add the following line to your Cartfile:
github "Camji55/Flipt-iOS-SDK" == 1.0.1
If you don't use CocoaPods, you can still add
Flipt as a submodule, drag and drop
Flipt.xcodeproj into your project, and embed
Flipt.framework in your target.
Flipt.xcodeprojto your project
- Select your app target
- Click the
+button on the
You can directly drag and drop the needed files into your project, but keep in mind that this way you won't be able to automatically get all the latest
Make sure to import the Flipt SDK:
Flipt needs to be configured with your endpoint. Use either one of the following:
Flipt.configure(withEndpoint: "YOUR FLIPT API ENDPOINT HERE")
Flipt.configure(withEndpoint: "YOUR FLIPT API ENDPOINT HERE", refreshRate: TIME IN SECONDS HERE)
Both require an enpoint to communicate with the Flipt API. Optionally you can pass in a time interval in seconds to refresh the feature flags. Default is 300 seconds (5 minutes).
Checking Flag Values
To view a value of a feature flag, use:
Flipt.isFlagEnabled("YOUR FLIPT FEATURE FLAG KEY")
Replace with the key of feature flag defined on the Flipt dashboard, and this function will return true or false on whether the flag is enabled.
Flipt also has support for a notification whenever the flags are refreshed:
Flipt was made by Mark Phelps
Flipt-iOS-SDK was made by Cameron Ingham
Flipt is available under the MIT license. See the LICENSE file for more info.