Skip to main content
Get up and running with ZeroSettleKit in minutes. This guide walks you through adding the Swift package to your Xcode project and making your first deposit.

Installation

Add ZeroSettleKit to your Xcode project using Swift Package Manager:
1

Open your Xcode project

Open your iOS app project in Xcode.
2

Add package dependency

  1. Go to FileAdd Package Dependencies…
  2. Enter the package URL:
https://github.com/zerosettle/zerosettle-ios
  1. Click Add Package
3

Select target

Choose your app target and click Add Package

Minimum Requirements

  • iOS 15.0+
  • Swift 5.7+
  • Xcode 14.0+

Basic Usage

1. Import the Framework

import ZSKit

2. Show the Prebuilt Deposit View

The fastest way to start accepting deposits is using the prebuilt ZSDepositView:
import SwiftUI
import ZeroSettleKit

struct ContentView: View {
    @State private var showDeposit = false
    @State private var balance: Int = 0 // Balance in cents
    
    var body: some View {
        VStack {
            Text("Balance: $\(Double(balance) / 100.0, specifier: "%.2f")")
            
            Button("Deposit USDC") {
                showDeposit = true
            }
        }
        .sheet(isPresented: $showDeposit) {
            ZSDepositView(
                walletAddress: "YOUR_WALLET_ADDRESS",
                onDeposit: { depositedAmountCents in
                    balance += depositedAmountCents
                    showDeposit = false
                }
            )
        }
    }
}
That’s it! The view handles:
  • Payment method selection (Apple Pay, Phantom, MetaMask, Coinbase Wallet)
  • Amount input (1,1, 2, 3,3, 5, $10, or custom)
  • Transaction submission
  • Real-time status updates
  • Error handling

3. Test the Integration

Build and run your app, then tap the button that shows the deposit view. You’ll see:
  1. Payment method options (Apple Pay, Phantom, MetaMask, Coinbase Wallet)
  2. Preset amount buttons (1,1, 2, 3,3, 5, $10) or custom amount input
  3. A deposit button
  4. Real-time transaction status
Start with 1or1 or 2 deposits while testing to minimize costs. The preset $1 button makes testing quick and easy!

What’s Next?

Getting Your Wallet Address

You need a wallet address to receive USDC deposits. ZeroSettle supports both Solana and Ethereum/Base addresses:
  1. Download Phantom wallet
  2. Create or import a wallet
  3. Tap your wallet name at the top
  4. Tap “Copy Address”
  5. Use this address - it looks like: 7xKXtg2CW87d97TXJSDpbD5jBkhe...
  1. Download MetaMask or Coinbase Wallet
  2. Create or import a wallet
  3. Copy your wallet address
  4. Use this address - it starts with 0x like: 0x742d35Cc6634C0532925a3b844...
Note: The same Ethereum address works on Base network
Security: Never store or expose private keys in your app. Only use public wallet addresses. Private keys should be stored securely on the backend or in user-controlled wallets only.

Common Issues

Solution: Make sure you’ve added the Swift package dependency and selected your app target. Clean and rebuild your project (Cmd+Shift+K, then Cmd+B).
Solution: Make sure you’re using a valid address format:
  • Solana: Base58-encoded, 32-44 characters (e.g., 7xKXtg2CW87...)
  • Ethereum/Base: Hex string starting with 0x, 42 characters (e.g., 0x742d35Cc...)
Never use private keys or seed phrases—only public addresses!
Solution: Test on a physical device, not the simulator. Wallet apps don’t work in the iOS Simulator. Make sure the wallet app is installed.
Solution:
  • Test on a physical device with an Apple Pay-enabled card
  • Ensure your Apple Developer account has Apple Pay entitlements
  • Add the Apple Pay capability to your app target in Xcode
  • Make sure you’re in a supported region
Solution: Remember all amounts are in cents, not dollars:
  • 100 cents = $1.00
  • 500 cents = $5.00
  • To display: "$\(Double(cents) / 100.0, specifier: "%.2f")"

Example Project

Want to see a complete working example? Check out the ZeroSettleKit Example App on GitHub. The example project demonstrates:
  • ✅ Basic deposit flow
  • ✅ Custom deposit UI
  • ✅ Error handling
  • ✅ Transaction tracking
  • ✅ All payment methods
Need help? Reach out to us at [email protected] or check the GitHub Discussions.