Add SwiftUI support for QRScanner framework #43
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive SwiftUI support to the QRScanner framework, enabling seamless integration with modern iOS applications built using SwiftUI.
Key Features
• SwiftUI Wrapper: New
QRScannerSwiftUIViewthat implementsUIViewRepresentableto bridge the existing UIKit-basedQRScannerViewto SwiftUI• Modern Architecture: Utilizes Swift's
MainActorfor thread-safe UI updates instead of legacyDispatchQueue.main.async• Complete Sample App: Added
QRScannerSwiftUISampledemonstrating real-world usage patterns• iOS 14+ Support: Updated minimum deployment target from iOS 10.0 to iOS 14.0 to support modern SwiftUI features
• Type-Safe Configuration: Comprehensive configuration options with sensible defaults
Technical Implementation
SwiftUI Integration
QRScannerSwiftUIViewacts as a bridge between UIKit and SwiftUI@BindingpropertiesModern Swift Concurrency
DispatchQueue.main.asyncwithTask { @MainActor in }for better performanceProject Structure
Usage Example
Breaking Changes
iOS Deployment Target: Minimum iOS version increased from 10.0 to 14.0
Test Plan
Compatibility
🤖 Generated with Claude Code