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() …