Release Date: January 10, 2025
Git Tag: v1.0.1
Commit: 6385828
This release focuses on dramatically simplifying the project structure and eliminating code duplication while preserving all public APIs.
- Removed entire
Sources/SwiftLivenessKit/directory containing 7 subdirectories and 20+ duplicate files - Eliminated ~90% of code duplication across the project
- Removed redundant test directory
Tests/SwiftLivenessKitTests/ - Net result: 1,188 lines deleted, 401 lines added (787 lines net reduction)
- Single source of truth - All functionality now lives in
Sources/LivenessDetection/only - Fixed type organization - Moved
SendableSettingsValuefrom vendor-specific files to core types - Fixed CompositeLivenessAdapter - Changed from incorrect dictionary structure to proper array-based vendor queue
- Improved separation of concerns - Core types no longer depend on vendor implementations
- Updated README.md - Reflects current clean state with proper installation instructions
- Updated CHANGELOG.md - Added comprehensive v1.0.1 entry with all changes
- Updated PROJECT_STATUS.md - Shows completed project status rather than incomplete state
- Added REFACTORING_SUMMARY.md - Detailed documentation of all refactoring work
- ✅ Clean Architecture - Single source of truth with no duplication
- ✅ Multi-Vendor Support - VendorA, VendorB, and Mock implementations
- ✅ Swift 6 Concurrency - Actor-based design with strict concurrency safety
- ✅ Reactive Events - AsyncThrowingStream for real-time updates
- ✅ Type Safety - Comprehensive error handling and configurations
- ✅ Memory Safety - Weak references and automatic cleanup
- ✅ Core Types - LivenessError, LivenessResult, LivenessEvent, LivenessConfiguration
- ✅ Protocols - LivenessVendorAdapter, LivenessAdapterFactory
- ✅ Base Classes - BaseLivenessAdapter, LivenessEnvironment
- ✅ Composite Pattern - CompositeLivenessAdapter with vendor fallback
- ✅ Vendor Adapters - Complete VendorA, VendorB, and Mock implementations
- ✅ Factory Pattern - DefaultAdapterFactory
- ✅ Test Infrastructure - Unit tests and mock implementations
dependencies: [
.package(url: "https://github.com/yourusername/SwiftLivenessKit.git", from: "1.0.1")
]import LivenessDetection
// Configure vendors
let vendorConfigs: [any LivenessConfiguration] = [
VendorAConfiguration(apiKey: "your-api-key"),
VendorBConfiguration(clientId: "your-client-id", clientSecret: "your-client-secret"),
MockConfiguration(shouldSucceed: true)
]
// Create composite adapter
let adapter = CompositeLivenessAdapter(
environment: LivenessEnvironment(
adapterFactory: DefaultAdapterFactory(),
logger: { print("LivenessKit: \($0)") }
),
vendorConfigurations: vendorConfigs
)
// Perform liveness detection
for try await event in adapter.startLivenessDetection(in: viewController) {
switch event {
case .started:
print("Started")
case .progress(let percentage):
print("Progress: \(Int(percentage * 100))%")
case .completed(let result):
print("Success! Confidence: \(result.confidence)")
case .failed(let error):
print("Error: \(error.localizedDescription)")
}
}- iOS 14.0+
- Swift 5.9+
- Xcode 15.0+
No migration required - All public APIs remain unchanged. The refactoring was purely internal structure cleanup.
- Simplified Development - Single directory structure is easier to navigate
- Reduced Maintenance - No duplicate code to maintain
- Improved Build Times - Fewer files to compile
- Better IDE Performance - Cleaner project structure
- Easier Onboarding - Clear, single implementation path
- Future-Proof - Clean architecture ready for new features
- Fixed incorrect CompositeLivenessAdapter dictionary structure
- Resolved type dependency issues in configuration protocol
- Eliminated build inconsistencies from duplicate implementations
None - All public APIs are preserved. This is a purely internal refactoring release.
This release represents a significant cleanup effort to make SwiftLivenessKit more maintainable and easier to use while preserving all existing functionality.
Previous Release: v1.0.0 - Initial release
Full Changelog: CHANGELOG.md