Skip to content
Native iOS SDK for Flipt
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Flipt.xcodeproj
Flipt
.gitignore
Flipt.podspec
LICENCE
README.md

README.md

Flipt iOS SDK

Version License Platform

A native client SDK for Flipt, written in Swift for iOS apps.

Contents of this Readme

Installation

CocoaPods

Flipt is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "Flipt"

Carthage

Flipt is available through Carthage. To install it, simply add the following line to your Cartfile:

github "Camji55/Flipt-iOS-SDK" == 1.0.1

Submodule

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.

  • Drag Flipt.xcodeproj to your project
  • Select your app target
  • Click the + button on the Embedded binaries section
  • Add Flipt.framework

Manual

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 Flipt features.

Usage

Setup

Make sure to import the Flipt SDK:

import Flipt

Flipt needs to be configured with your endpoint. Use either one of the following:

Flipt.configure(withEndpoint: "YOUR FLIPT API ENDPOINT HERE")

or

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.

Notifications

Flipt also has support for a notification whenever the flags are refreshed:

Notification.Name.FliptFlagsUpdated

Authors

Flipt was made by Mark Phelps

Flipt-iOS-SDK was made by Cameron Ingham

License

Flipt is available under the MIT license. See the LICENSE file for more info.

You can’t perform that action at this time.