Core API
Card Form
Payment Methods
Theming
Common Objects
Session pattern
The iOS SDK offers a managed checkout and a composable one. The managed checkout,PrimerCheckout in SwiftUI or PrimerCheckoutPresenter from UIKit, builds its own checkout and needs no session. An observable PrimerCheckoutSession drives the composable views and owns the checkout lifecycle. It loads the client session and tracks the lifecycle Phase. In SwiftUI, outcomes reach your onCompletion handler as PrimerCheckoutState. .failure arrives once per failed attempt. .success or .dismissed arrives at most once and ends the checkout. With the default error screen, the shopper can retry after a failed payment. If initialization fails, an inline PrimerCheckoutSession ends after that single .failure.
Composable (inline)
Hold aPrimerCheckoutSession as a @StateObject, then attach it to your view hierarchy with the .primerCheckoutSession(_:theme:onCompletion:) modifier. The composable views — PrimerCardForm, PrimerPaymentMethods, and PrimerVaultedPaymentMethods — resolve their per-feature session from the SwiftUI environment and expose slots you can override. PrimerCardForm and PrimerPaymentMethods take @ViewBuilder slots. PrimerVaultedPaymentMethods slots return AnyView, so wrap your custom content in AnyView.
PrimerCardForm slots, the PrimerPaymentMethods header and emptyState slots, and the PrimerVaultedPaymentMethods header slot receive their session as a parameter. Use it to read state and call actions from your custom UI. The PrimerPaymentMethods method slot and the PrimerVaultedPaymentMethods item and submitButton slots receive only row data and callbacks.
Sessions are
@MainActor ObservableObjects. Observe them with @StateObject (when you own them) or @ObservedObject (when they are passed into a slot), and read their @Published state/phase directly in your views.Managed (modal)
For a turnkey flow that renders the SDK’s default screens, usePrimerCheckout in SwiftUI, or PrimerCheckoutPresenter from UIKit.
See also
PrimerCheckoutSession
Own the checkout lifecycle for inline, composable checkout.
PrimerCheckout
Drop in the managed SwiftUI checkout view.
PrimerCardForm
Build a custom card form with @ViewBuilder slots.
Handle payment result
React to the final PrimerCheckoutState.