Skip to main content
Github Repository: https://github.com/KlipFit/kleep-spm Version history: see iOS SDK - Version history for the latest version and the changes in each release.

Installation


This process needs to be followed only once, the first time you need to install the SDK in your project. To update the SDK later, in Xcode choose File > Packages > Update to Latest Package Versions (see the version history).
  1. Add the following package: https://github.com/KlipFit/kleep-spm
  2. Change dependency rule to: up to next major version

Permissions


Add the following permission to your project on info.plist: NSCameraUsageDescription

Usage


Method 1: requestSize

This method allows to implement the logic of the CTA. Logic schema This schema explains how to update the CTA opening Kleep. https://www.figma.com/board/BlurZ01lR3JBQZeTUU98TE/Mobile---CTA-Logic?node-id=0-1&t=ccXWciNziIdfhgew-1 Implementation example

Method 2: loadView

This method is called when the CTA is clicked. It allows to load the different screens. The developper integrating the SDK should embed them into a bottom sheet. Implementation example
Present the returned KlipftNavigationController the way you like: SwiftUI .sheet, or .pageSheet, .fullScreen or .overFullScreen in UIKit, including on top of another modal. The size guide stays inside the safe area and draws its own navigation bar (back and close): there is nothing to hide or configure. Requires SDK 4.3.0 or later. The SDK currently supports 6 UI languages, passed as language: KleepLanguageCode:
  • fr — French (default)
  • en — English
  • es — Spanish
  • it — Italian
  • pt — Portuguese
  • nl — Dutch
If a language you need isn’t in the list, contact your Kleep representative.

Method 3: track

This method allows to track custom events.
We want to track 3 events: product_viewed Parameters Example
product_added_to_cart Parameters Example
checkout_completed Parameters Example

A/B testing


Kleep runs experiments on parts of the sizing flow (CTA copy, layout, timing) to keep improving conversion, using the same experimentation layer already used across Kleep’s web integrations, built on PostHog. PostHog is embedded inside the Kleep SDK — you don’t need to add the PostHog SDK yourself, request any extra permission, or call any additional method. Here’s how the variant assignment flows internally: The assignment is keyed on a stable on-device ID, so a given install keeps seeing the same variant for the duration of the experiment instead of being re-rolled on every launch. You don’t read or set the variant yourself — Kleep resolves it internally and reports the conversion delta per variant on its side.