Swift SDK
Swiftv1.0.1
Requirements
Section titled “Requirements”- Swift 5.9+
- macOS 13.0+ / iOS 16.0+ / tvOS 16.0+ / watchOS 9.0+
Installation
Section titled “Installation”Add to your Package.swift:
dependencies: [ .package(url: "https://github.com/flags-gg/swift.git", from: "1.0.1")]Or in Xcode: File > Add Packages and enter the repository URL.
Quick Start
Section titled “Quick Start”import FlagsGG
let client = try Flags.builder() .withAuth(Auth( projectId: "your-project-id", agentId: "your-agent-id", environmentId: "your-environment-id" )) .build()
// Check a flaglet enabled = await client.is("my-feature").enabled()
// List all flagslet flags = try await client.list()for flag in flags { print("\(flag.details.name): \(flag.enabled)")}Batch Operations
Section titled “Batch Operations”// Check multiple flags at oncelet results = await client.getMultiple(["feature-1", "feature-2"])
// Check if all flags are enabledif await client.allEnabled(["feature-1", "feature-2"]) { print("All enabled")}
// Check if any flag is enabledif await client.anyEnabled(["premium", "beta"]) { print("At least one enabled")}