# Lite SDK (Payment iOS)

<Warning>

**Orientation: Choosing Your Integration Flow**, before you begin, please review the [Official Integration Flow](/docs/sdks/overview/understanding-flows).
- **Standard Flow ([Full Checkout](/docs/sdks/full-checkout/web-payments))**: Recommended for most merchants. WHITELABEL handles the UI, security, and automatic updates for payment methods.  
- **Custom Flow (This SDK)**: Use this only if you require full control over the UX. **Note**: You will be responsible for manually handling payment statuses, 3DS transitions, and fraud routing data collection.
</Warning>
## Step 1: Include the library in your project

### CocoaPods

Add the following line to your Podfile:

```ruby
pod 'YunoSDK', '~> 1.1.22'
```

### Swift Package Manager

Add `YunoSDK` as a dependency:

```swift
.package(url: "https://github.com/yuno-payments/yuno-sdk-ios.git", .upToNextMajor(from: "1.1.17"))
```

## Step 2: Initialize SDK

Initialize the SDK with your Public API Key:

```swift
import YunoSDK

Yuno.initialize(
    apiKey: "PUBLIC_API_KEY",
    config: YunoConfig(),
    callback: { (value: Bool) in }
)
```

## Step 3: Adopt YunoPaymentDelegate

Adopt the `YunoPaymentDelegate` protocol:

<Info>
**Swift 6 Concurrency Requirements**

If you're using Swift 6, you'll need to implement the `YunoPaymentDelegate` protocol with specific concurrency considerations. See the [Swift 6 Concurrency](/docs/sdks/resources/swift-6-concurrency) guide for detailed implementation options and best practices.
</Info>

```swift
class ViewController: UIViewController, YunoPaymentDelegate {
    var checkoutSession: String { "checkout_session" }
    var countryCode: String { "US" }
    var viewController: UIViewController? { self }

    func yunoCreatePayment(with token: String) {
        // Call your backend to create a payment
    }

    func yunoPaymentResult(_ result: Yuno.Result) {
        // Handle final payment state
    }
}
```

## Step 4: Initiate the payment process

```swift
startPaymentLite(
    with: self,
    paymentSelected: paymentSelected,
    showPaymentStatus: true
)
```

## Step 5: Continue payment (Required)

If `sdk_action_required: true` is returned by the API, call:

```swift
Yuno.continuePayment()
```

<Note>
**Demo App**

See the [WHITELABEL iOS SDK repository](https://github.com/yuno-payments/yuno-sdk-ios) for full implementation examples.
</Note>