iOS feature flags installation
PostHog is available through CocoaPods or you can add it as a Swift Package Manager based dependency.
CocoaPods
Podfile
Swift Package Manager
Add PostHog as a dependency in your Xcode project "Package Dependencies" and select the project target for your app, as appropriate.
For a Swift Package Manager based project, add PostHog as a dependency in your Package.swift file's Package dependencies section:
Package.swift
and then as a dependency for the Package target utilizing PostHog:
Package.swift
Configuration
Configuration is done through the PostHogConfig object. Here's a basic configuration example to get you started.
You can find more advanced configuration options in the configuration page.
Swift
Swift
Next steps
| Resource | Description |
|---|---|
| Adding feature flag code | How to check flags in your code for all platforms |
| Framework-specific guides | Setup guides for React Native, Next.js, Flutter, and other frameworks |
| How to do a phased rollout | Gradually roll out features to minimize risk |
| More tutorials | Other real-world examples and use cases |