> This page is for version v2 (default).
> For other versions, use one of these documentation indexes:
> - v2 (default): https://developers.clearpay.co.uk/v-2/llms.txt
> - v1: https://developers.clearpay.co.uk/v-1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.clearpay.co.uk/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.clearpay.co.uk/_mcp/server.

# iOS SDK

The [Afterpay iOS SDK](https://github.com/afterpay/sdk-ios) presents Clearpay checkout in your iOS app and provides prebuilt UI components, such as the payment button and price breakdown. With a UK configuration, the SDK shows Clearpay branding. Its APIs use the Afterpay name, for example `Afterpay.setConfiguration`.

## What the SDK includes

### Checkout

The SDK presents checkout in these ways:

* [Checkout V2](/guides/sdk/ios-sdk/implementation-guide) (recommended): the SDK shows a loading screen, asks your app for a checkout token from your server, and opens Clearpay checkout. Supports standard and express checkout.
* [Checkout V1](/guides/sdk/ios-sdk/more/checkout-v1) (deprecated): your server returns a checkout URL, and the SDK loads it in a web view. Supports standard checkout only.

### UI components

The SDK includes prebuilt components that follow Clearpay brand guidelines. With a UK configuration, they show Clearpay branding.

* [Payment button](/guides/sdk/ios-sdk/ui-components/payment-button): `PaymentButton` starts a Clearpay checkout.
* [Lockup](/guides/sdk/ios-sdk/ui-components/lockup): `LockupView` shows the Clearpay logo.
* [Price breakdown](/guides/sdk/ios-sdk/ui-components/price-breakdown): `PriceBreakdownView` shows the installment amounts for a price.
* [Checkout widget](/guides/sdk/ios-sdk/ui-components/checkout-widget): `WidgetView` shows the payment schedule and updates when you send it a new total.

For branding, color schemes, and accessibility, see [iOS UI components](/guides/sdk/ios-sdk/ui-components).

## Requirements

* iOS 12.0 or later
* Swift 5.7 or later
* Xcode 14.0 or later

> **WebView support**
>
> Clearpay checkout runs in a `WKWebView` that requires iOS Safari 13.4 or later. The SDK runs on iOS 12, but your app must hide Clearpay from customers on earlier versions. For example, wrap your Clearpay views in an `if #available(iOS 13.4, *)` check.

## Get started

* Follow the [iOS implementation guide](/guides/sdk/ios-sdk/implementation-guide) to install the SDK, configure it, and present checkout.
* To take your first sandbox payment end to end, see the [Mobile SDK quickstart](/guides/sdk/quickstart).