Skip to main content

UIKit Integration

A complete example showing SpendOwl integration in a UIKit app.

Project Setup

1

Add SpendOwl Package

In Xcode, go to File → Add Package Dependencies and add:
2

Configure in AppDelegate

Call SpendOwl.configure() in didFinishLaunchingWithOptions.
3

Access Attribution

Use try await SpendOwl.attribution() in your view controllers.

Complete Example

AppDelegate.swift

Configure SpendOwl when the app launches:

AttributionViewController.swift

Display attribution data and manage user identity:

Key Patterns

MainActor for UI Updates

Always update UI on the main thread:

SceneDelegate Setup

For apps using SceneDelegate:

Authentication Integration

Set user ID in your login flow:

Download Example

The complete example project is available on GitHub:

SpendOwlDemo-UIKit

Download the complete UIKit example