Swift SDK
Revieve — a thin, typed client for analyzeImage. Source lives in sdks/swift/.
Install
Section titled “Install”In Package.swift:
.package(url: "https://github.com/revieve/revieve-sdk-swift", from: "0.1.0")In Xcode: File → Add Package Dependencies… and paste the same URL.
Targets iOS 15+, macOS 12+, visionOS 1+.
Quick start
Section titled “Quick start”import Revieve
let revieve = try SkinAnalysisClient(partnerId: "jmlv6b2qtS")
let result = try await revieve.analyzeImage( .init( image: imageData, components: [.wrinkles, .redness, .skin_age], gender: .unknown, skintone: 0 ))
print(result.message, result.results.count)Errors
Section titled “Errors”do { let result = try await revieve.analyzeImage(.init(image: imageData)) render(result)} catch let error as RevieveError { if case .analysis(let message, _) = error { showToast(message) log(error.firstErrorIdx) } else { throw error }}Test injection
Section titled “Test injection”Pass a custom URLSession for mocking. Combined with URLProtocol-based fakes this gives full control over the request/response cycle.
let mockConfig = URLSessionConfiguration.ephemeralmockConfig.protocolClasses = [MockURLProtocol.self]let session = URLSession(configuration: mockConfig)
let revieve = try SkinAnalysisClient( partnerId: "test", baseURL: URL(string: "https://example.invalid/api/3/")!, session: session)