scanbot-sdk-example-ios
scanbot-sdk-example-ios copied to clipboard
Xcode Compatibility Enhancement: @retroactive Attribute Implementation
Xcode Compatibility Enhancement: @retroactive Attribute Implementation
Description
While working with the SwiftUIComponentsExample project, I noticed that builds on Xcode 15.4 and 15.1 encounter an issue with the @retroactive attribute. I'd like to share my findings and suggest a potential solution that might help other developers.
Current Behavior
- ❌ Xcode 15.1: Build fails due to unrecognized
@retroactiveattribute - ❌ Xcode 15.4: Same behavior as 15.1
- ✅ Xcode 16.0: Works as expected
Technical Details
The compiler doesn't recognize the @retroactive attribute when implementing Identifiable conformance for SBSDKScannedPage in Xcode versions prior to 16.0.
Suggested Solution
I found that implementing a conditional compilation block resolves this issue while maintaining compatibility across Xcode versions
#if hasFeature(RetroactiveAttribute)
extension SBSDKScannedPage: @retroactive Identifiable { }
#else
extension SBSDKScannedPage: Identifiable { }
#endif
Benefits
This enhancement would help developers who are using various Xcode versions to work with the SDK more smoothly, especially those who haven't upgraded to Xcode 16.0 yet.
I hope this suggestion is helpful. Please let me know if you need any additional information or clarification.
Hello @yemretekin, thank you very much for your detailed feedback. Much appreciated! Our next SDK release will fix this issue as you suggested.