PrimerCheckoutPresenter is the UIKit entry point for the managed checkout. It presents the
CheckoutComponents UI from a UIViewController and delivers results through a delegate, acting as a
bridge between UIKit apps and the underlying SwiftUI implementation.
For pure SwiftUI apps, use
PrimerCheckout
directly instead of this class. PrimerCheckoutPresenter exists for view-controller based
navigation and Objective-C interoperability.Declaration
@MainActor singleton: call its static methods from the main thread (the
default for UIKit lifecycle callbacks). It is also exposed to Objective-C via @objc.
Properties
delegate is a weak reference. Retain the object you assign (for example the presenting view
controller) for as long as checkout is on screen, otherwise callbacks will not fire.Presenting checkout
presentCheckout has four overloads. They differ only in how much you configure and whether you
supply the presenting view controller yourself. All overloads accept an optional trailing
completion closure that runs once the checkout UI has finished presenting.
None of these parameters have Swift defaults. The overloads that omit settings or theme apply the
SDK’s current global PrimerSettings and a default PrimerCheckoutTheme() internally.
From an explicit view controller
With automatic view controller detection
These overloads locate the top-most presenting view controller for you, which is convenient when you do not have a view controller reference at hand.Parameters
The overloads that take
primerSettings or primerTheme are not @objc compatible because of
those Swift-only parameter types. From Objective-C, use the clientToken /
clientToken:from: overloads, or configure settings globally via PrimerSettings.Dismissing checkout
Calling
dismiss triggers primerCheckoutPresenterDidDismiss() on the delegate. The checkout also
dismisses itself automatically when a payment succeeds or fails.
PrimerCheckoutPresenterDelegate
Required methods
Optional 3DS lifecycle methods
Implement these only if you need to observe the 3-D Secure challenge lifecycle. Each has a default empty implementation, so you can omit any you do not need.PaymentResult
The success callback delivers aPaymentResult value.
PaymentStatus
UIKit usage example
PrimerCheckoutPresenter.shared.delegate is weak. Keep the conforming object (here, the view
controller) alive for the duration of checkout so the callbacks are delivered.See also
PrimerCheckout
The SwiftUI view for embedding checkout directly in a SwiftUI hierarchy.
PrimerCheckoutState
The state model that drives the managed checkout flow.
PrimerError
The error type delivered to the failure callback.
UIKit integration
A guide to integrating the managed checkout in UIKit apps.