# Dependencies

Relevant source files

- [LinkSDK.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved](https://github.com/FrontFin/mesh-ios-sdk/blob/02fd63b0/LinkSDK.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved)
- [LinkSDK/TrueAuthWebViewController/TrueAuthWebViewController.swift](https://github.com/FrontFin/mesh-ios-sdk/blob/02fd63b0/LinkSDK/TrueAuthWebViewController/TrueAuthWebViewController.swift)
- [Package.resolved](https://github.com/FrontFin/mesh-ios-sdk/blob/02fd63b0/Package.resolved)
- [Package.swift](https://github.com/FrontFin/mesh-ios-sdk/blob/02fd63b0/Package.swift)

This document covers external dependencies used by the LinkSDK, focusing on dependency management, version control, and integration patterns. The primary external dependency is the QuantumIOS framework, which provides core security and web content handling capabilities.

For information about the SDK's internal architecture and component relationships, see [Core Architecture](/content/FrontFin/mesh-ios-sdk/3-core-architecture/index.html).

## External Dependencies Overview

The LinkSDK has minimal external dependencies, with QuantumIOS being the primary external framework. The SDK leverages standard iOS frameworks (`UIKit`, `WebKit`, `SafariServices`) that are part of the iOS platform.

### Dependency Hierarchy

```
Security Operations

UI Components

Web View Rendering

Browser Integration

LinkSDK Package

QuantumIOS Framework
v3.17.0

UIKit
(iOS Platform)

WebKit
(iOS Platform)

SafariServices
(iOS Platform)

Foundation
(iOS Platform)
```

Sources: [Package.swift18-23](https://github.com/FrontFin/mesh-ios-sdk/blob/02fd63b0/Package.swift#L18-L23) [LinkSDK/TrueAuthWebViewController/TrueAuthWebViewController.swift8-11](https://github.com/FrontFin/mesh-ios-sdk/blob/02fd63b0/LinkSDK/TrueAuthWebViewController/TrueAuthWebViewController.swift#L8-L11)

## QuantumIOS Framework Integration

QuantumIOS is the core external dependency, providing security operations and web content handling capabilities. The framework is pinned to an exact version to ensure stability.

### QuantumIOS Configuration in Package Manifest

| Configuration Aspect | Value | Purpose |
| --- | --- | --- |
| Repository URL | `https://github.com/atomicfi/quantum-ios.git` | Source location |
| Version Constraint | `exact: "3.17.0"` | Pin to specific version |
| Product Name | `QuantumIOS` | Framework import name |
| Linker Setting | `.linkedFramework("QuantumIOS")` | Framework linking |

The dependency is configured with exact version pinning to prevent unexpected updates:

```
dependencies: [\
    .package(\
        url: "https://github.com/atomicfi/quantum-ios.git",\
        exact: "3.17.0"\
    )\
]
```

Sources: [Package.swift18-23](https://github.com/FrontFin/mesh-ios-sdk/blob/02fd63b0/Package.swift#L18-L23)

### QuantumIOS Usage Patterns

```
QuantumIOS Operations

creates

provides

provides

initialize(token:view:controller:)

goto(url:)

cleanup()

TrueAuthWebViewController

Quantum()
Class Instance

WKWebView
Web Container

UIViewController
Parent Controller

initialize(token, view, controller)

goto(url)

cleanup()
```

Sources: [LinkSDK/TrueAuthWebViewController/TrueAuthWebViewController.swift27-28](https://github.com/FrontFin/mesh-ios-sdk/blob/02fd63b0/LinkSDK/TrueAuthWebViewController/TrueAuthWebViewController.swift#L27-L28) [LinkSDK/TrueAuthWebViewController/TrueAuthWebViewController.swift84-92](https://github.com/FrontFin/mesh-ios-sdk/blob/02fd63b0/LinkSDK/TrueAuthWebViewController/TrueAuthWebViewController.swift#L84-L92)

The `Quantum` class is instantiated and used for:

- **Token-based initialization**: `quantum.initialize(token: configuration.atomicToken, view: webView, controller: self)`
- **URL navigation**: `quantum.goto(url: configuration.url)`
- **Resource cleanup**: `quantum.cleanup()`

Sources: [LinkSDK/TrueAuthWebViewController/TrueAuthWebViewController.swift47](https://github.com/FrontFin/mesh-ios-sdk/blob/02fd63b0/LinkSDK/TrueAuthWebViewController/TrueAuthWebViewController.swift#L47-L47) [LinkSDK/TrueAuthWebViewController/TrueAuthWebViewController.swift86-87](https://github.com/FrontFin/mesh-ios-sdk/blob/02fd63b0/LinkSDK/TrueAuthWebViewController/TrueAuthWebViewController.swift#L86-L87) [LinkSDK/TrueAuthWebViewController/TrueAuthWebViewController.swift111](https://github.com/FrontFin/mesh-ios-sdk/blob/02fd63b0/LinkSDK/TrueAuthWebViewController/TrueAuthWebViewController.swift#L111-L111)

## Dependency Management

The LinkSDK uses Swift Package Manager (SPM) for dependency management, with different resolution mechanisms for different development contexts.

### Package Resolution Files

The project maintains multiple `Package.resolved` files for different contexts:

| File Location | Purpose | Git Repository Format |
| --- | --- | --- |
| `Package.resolved` | SPM distribution | HTTPS URL |
| `LinkSDK.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved` | Xcode development | SSH URL |

Both files resolve to the same commit hash and version:

```
{
  "revision": "e66d3b8e4bfc83c5074a5edde3ef2718d9406a11",
  "version": "3.17.0"
}
```

Sources: [Package.resolved8-9](https://github.com/FrontFin/mesh-ios-sdk/blob/02fd63b0/Package.resolved#L8-L9) [LinkSDK.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved9-10](https://github.com/FrontFin/mesh-ios-sdk/blob/02fd63b0/LinkSDK.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved#L9-L10)

### Swift Package Manager Configuration

```
Target Configuration

defines

declares

depends on

from

Package.swift
Main Manifest

LinkSDK Target

QuantumIOS Product

quantum-ios Package

dependencies: [.product(name: QuantumIOS)]

linkerSettings: [.linkedFramework(QuantumIOS)]
```

Sources: [Package.swift24-35](https://github.com/FrontFin/mesh-ios-sdk/blob/02fd63b0/Package.swift#L24-L35)

The target configuration specifies:
- **Product dependency**: `.product(name: "QuantumIOS", package: "quantum-ios")`
- **Linker framework**: `.linkedFramework("QuantumIOS")`

Sources: [Package.swift28](https://github.com/FrontFin/mesh-ios-sdk/blob/02fd63b0/Package.swift#L28-L28) [Package.swift32](https://github.com/FrontFin/mesh-ios-sdk/blob/02fd63b0/Package.swift#L32-L32)

## Platform and Version Requirements

The LinkSDK specifies minimum platform requirements that affect dependency resolution:

| Requirement | Value | Impact |
| --- | --- | --- |
| iOS Minimum Version | iOS 13.0 | Determines available APIs |
| Swift Tools Version | 5.7 | Language feature support |
| Default Localization | `en` | String resource handling |

Sources: [Package.swift1](https://github.com/FrontFin/mesh-ios-sdk/blob/02fd63b0/Package.swift#L1-L1) [Package.swift8](https://github.com/FrontFin/mesh-ios-sdk/blob/02fd63b0/Package.swift#L8-L8) [Package.swift10](https://github.com/FrontFin/mesh-ios-sdk/blob/02fd63b0/Package.swift#L10-L10)

## Import and Usage Patterns

QuantumIOS is imported and used in authentication components:

```
import QuantumIOS
import SafariServices
import UIKit
@preconcurrency import WebKit
```

The framework integrates with standard iOS frameworks through:
- **Async initialization**: Using `Task` and `async/await` patterns
- **WebKit integration**: Providing `WKWebView` instances to Quantum
- **UIKit lifecycle**: Managing view controller presentation

Sources: [LinkSDK/TrueAuthWebViewController/TrueAuthWebViewController.swift8-11](https://github.com/FrontFin/mesh-ios-sdk/blob/02fd63b0/LinkSDK/TrueAuthWebViewController/TrueAuthWebViewController.swift#L8-L11) [LinkSDK/TrueAuthWebViewController/TrueAuthWebViewController.swift84-92](https://github.com/FrontFin/mesh-ios-sdk/blob/02fd63b0/LinkSDK/TrueAuthWebViewController/TrueAuthWebViewController.swift#L84-L92)
