This project is for demonstration and reference purposes only. It is not intended for use in production environments. The code, configuration, and architecture shown here illustrate SDK integration patterns — adapt them to your own security requirements, backend infrastructure, and key management practices before shipping to production.
Demonstrates integrating the Spreedly iOS SDK into a merchant application. The project includes two variant builds — one using Swift Package Manager and one using CocoaPods — that share the same application code.
Each variant contains a SwiftUI (Swift) target and a UIKit (Objective-C) target, showing both language integration paths.
SDK Version: 1.3.8
| Requirement | Version |
|---|---|
| Xcode | 16.0+ |
| iOS Deployment | 14.0+ |
| Swift | 5.10+ |
| XcodeGen | 2.40+ (to regenerate .xcodeproj) |
| CocoaPods | 1.15+ (CocoaPods variant only) |
| Module | Product | Description |
|---|---|---|
| SpreedlyCore | SpreedlyCore |
SpreedlyCore framework |
| SpreedlySecurity | SpreedlySecurity |
SpreedlySecurity framework |
| SpreedlyUI | SpreedlyUI |
SpreedlyUI framework |
| SpreedlyStripeAPM | SpreedlyStripeAPM |
SpreedlyStripeAPM framework |
| SpreedlyBraintree | SpreedlyBraintree |
SpreedlyBraintree framework |
-
Copy the template at the repository root:
cp SpreedlyKeys.xcconfig.example SpreedlyKeys.xcconfig
-
Open
SpreedlyKeys.xcconfigand fill in your Spreedly environment key, server URL, and other credentials. This file is git-ignored and will not be committed. -
Both variants read these values from
Info.plistat runtime via$(VARIABLE_NAME)substitution.
Security note: Values injected via xcconfig end up in the compiled
Info.plistinside the app binary. This is acceptable for a demo, but production apps should fetch sensitive credentials from a secure backend rather than embedding them in the client. If you accidentally commit or share real keys, rotate them immediately.
# (Re)generate the Xcode project from project.yml
cd ExampleSPM
xcodegen generate
# Open in Xcode
open MerchantExampleSPM.xcodeproj- Xcode will automatically resolve SPM dependencies on first open.
- Select the MerchantExampleSPM (Swift) or MerchantExampleSPMObjC (Objective-C) scheme.
- Build & run on a simulator or device.
# (Re)generate the Xcode project from project.yml
cd ExampleCocoaPods
xcodegen generate
# Install pods
pod install
# Open the workspace (NOT the .xcodeproj)
open MerchantExamplePods.xcworkspace- Select the MerchantExamplePods (Swift) or MerchantExamplePodsObjC (Objective-C) scheme.
- Build & run on a simulator or device.
To build against a local checkout of checkout-ios-package:
- Open
ExampleCocoaPods/Podfile. - Set
USE_LOCAL_PACKAGE = true. - Update
LOCAL_PACKAGEto point to your localcheckout-ios-packagedirectory. - Run
pod installagain.
| # | Screen | Description |
|---|---|---|
| 1 | Basic Checkout | Drop-in CardFormDropIn with default fields (name, card, expiry, CVC). |
| 2 | Checkout with Additional Fields | CardFormDropIn with extra billing/address fields (address, city, state, ZIP). |
| 3 | Custom Form | Headless UI — builds card form field-by-field using individual SPLTextField components. |
| 4 | Custom Theme | Custom light/dark themes applied to SPLTextField components. |
| 5 | CVV Recaching | Update CVV on a saved payment method (sheet or dialog presentation). |
| 6 | 3DS Global Flow | Purchase with Forter-based Global 3D Secure challenge. |
| 7 | 3DS Gateway-Specific | Purchase with gateway-specific 3DS (device fingerprint, challenge, frictionless). |
| 8 | Offsite Payment | PayPal / Sprel offsite redirect-based payment flow. |
| 9 | EBANX Payment | Pix, Boleto, OXXO, NuPay offsite payment methods via EBANX. |
| 10 | Stripe APM | Stripe Alternative Payment Methods via SpreedlyStripeAPM. |
| 11 | Braintree Payment | PayPal / Venmo via SpreedlyBraintree. |
checkout-ios-example/
README.md
LICENSE
.gitignore
SpreedlyKeys.xcconfig.example
Shared/ # Shared source files (both variants)
Swift/ # SwiftUI views, config, API clients
ObjC/ # UIKit view controllers, config, API clients
ExampleSPM/ # SPM variant
project.yml # XcodeGen spec
MerchantExampleSPM.xcodeproj # Generated (git-ignored)
MerchantExampleSPM/ # Swift/SwiftUI entry point
MerchantExampleSPMObjC/ # ObjC/UIKit entry point
ExampleCocoaPods/ # CocoaPods variant
project.yml # XcodeGen spec
Podfile
Gemfile
MerchantExamplePods.xcodeproj # Generated by pod install (git-ignored)
MerchantExamplePods.xcworkspace # Generated by pod install (git-ignored)
MerchantExamplePods/ # Swift/SwiftUI entry point
MerchantExamplePodsObjC/ # ObjC/UIKit entry point
Config/ # Wrapper xcconfigs (merge keys + Pods configs)
- Spreedly Documentation: docs.spreedly.com
- Support Portal: spreedly.com/support
- Terms of Service
- Privacy Policy
- License (Apache 2.0)