Upgrading from posthog-ios 3.x.x? See the migration guide.
Please see the main PostHog docs.
Specifically, the iOS docs details.
Install PostHog with Swift Package Manager. In Xcode, choose File > Add Package Dependencies… and enter https://github.com/PostHog/posthog-ios, or add it to your Package.swift:
dependencies: [
.package(url: "https://github.com/PostHog/posthog-ios.git", from: "4.0.0")
]posthog-ios 4.0.0 and later is only published to Swift Package Manager. Versions 3.x.x stay on CocoaPods, but no new versions will be pushed there: CocoaPods trunk becomes read-only on December 2, 2026.
To move an app from CocoaPods, remove pod 'PostHog' from your Podfile, run pod install, then add the package as shown above.
React Native and Flutter apps get this SDK through their PostHog package. Follow that package's installation docs instead.