Skip to content

Instantly share code, notes, and snippets.

@quentinfasquel
Created March 11, 2025 19:59
Show Gist options
  • Save quentinfasquel/bf911ce435ad685edefebea48910127c to your computer and use it in GitHub Desktop.
Save quentinfasquel/bf911ce435ad685edefebea48910127c to your computer and use it in GitHub Desktop.
Package.swift
// swift-tools-version: 5.9
import PackageDescription

let package = Package(
   name: "CaptureSDK",
   products: [
       .library(name: "Capture", targets: ["Capture"]),
       .library(name: "CaptureUI", targets: ["CaptureUI"]),
   ],
   targets: [
        .target(name: "Capture"),
        .target(name: "CaptureUI", dependencies: ["Capture"]),
   ]
)
Sources/Capture/Capture.swift
//
// Capture.swift
// CaptureSDK/Capture
//
public import AVFoundation

@_spi(CaptureUI)
public class CameraService {
    public init(session: AVCaptureSession) {
    }
}
Sources/CaptureUI/CaptureUI.swift
//
// CaptureUI.swift
// CaptureSDK/CaptureUI
//
@_spi(CaptureUI) import Capture
// Can now use CameraService() …
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment