1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-19 01:17:18 +02:00
unleash.unleash/frontend/src/component/onboarding/dialog/snippets/swift.md
Jaanus Sellin 4397af0df7
chore: move onboarding flow and dialog under same location (#8272)
It is mostly moving the onboarding folders under same directory for more
clear project structure.
2024-09-26 12:56:49 +03:00

640 B

1. Install the SDK

// Instructions to add the Swift SDK can be found at the provided URL:
https://github.com/Unleash/unleash-proxy-client-swift.git

2. Initialize Unleash

import Foundation
import UnleashProxyClientSwift

var unleash = UnleashProxyClientSwift.UnleashClient(
   unleashUrl: "<YOUR_API_URL>",
   clientKey: "<YOUR_API_TOKEN>",
   refreshInterval: 15,
   appName: "unleash-onboarding-swift",
   context: [:])

unleash.start()

3. Check feature flag status

Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { _ in
    print("Is enabled", unleash.isEnabled(name: "<YOUR_FLAG>"))
}