Installation
Swift Package Manager
In Xcode: File → Add Packages, then enter:Package.swift:
SteadpayUI as a target dependency (and optionally Steadpay for direct client usage):
Quick start
Wrap the authenticated portion of your app inSteadpayGate:
- Active —
YourApprenders normally - Warning — dismissable banner above content
- Lockout — full-screen overlay until card is updated
Parameters
| Parameter | Type | Required | Default |
|---|---|---|---|
tenantSlug | String | ✓ | — |
customerId | String | ✓ | — |
publishableKey | String | ✓ | — |
apiBase | String | ✓ | — |
pollInterval | TimeInterval | 600 | |
forcedStatus | SteadpayStatus? | nil | |
callbacks | SteadpayCallbacks? | nil | |
lockoutScreen | ((@escaping () -> Void, Entitlements?) -> AnyView)? | built-in | |
warningBanner | ((@escaping () -> Void, @escaping () -> Void) -> AnyView)? | built-in | |
content | @ViewBuilder | ✓ | — |
Callbacks
Custom enforcement UI
Wrap your views inAnyView(...):
Testing
Force a state
forcedStatus is set. Remove before shipping.
Interactive sandbox
DEV badge appears in the bottom-right corner. Tap to open a sheet with state pills and a callback log. Remove before shipping to production.
UIKit / non-SwiftUI usage
Use theSteadpay target directly with Combine:
client.stop() in deinit or viewDidDisappear.