-
Notifications
You must be signed in to change notification settings - Fork 77
Fix IterableDataRegion by adding @objc annotation and creating Object… #913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix IterableDataRegion by adding @objc annotation and creating Object… #913
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #913 +/- ##
===========================================
- Coverage 85.19% 69.05% -16.15%
===========================================
Files 91 104 +13
Lines 6301 7522 +1221
===========================================
- Hits 5368 5194 -174
- Misses 933 2328 +1395 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
* master: [MOB-11252] - Sequential accessing EM (#912)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@objc public class IterableDataRegion: NSObject { | ||
@objc public static let US = "https://api.iterable.com/api/" | ||
@objc public static let EU = "https://api.eu.iterable.com/api/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No native enum support in objc was indeed a new learning for me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 things to monitor will be :
- Devs using this enum for EU.
- RN layer or other platforms relying on native SDK getting affected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an Objective-C compatibility issue by converting IterableDataRegion from a Swift enum to an @objc class and adds the necessary test and project configuration updates. Key changes include:
- Adding the @objc annotation and converting IterableDataRegion to a class.
- Including an Objective-C unit test (IterableDataRegionObjCTests.m) to verify the fix.
- Updating the project file and bridging header configuration to support the Objective-C integration.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
tests/unit-tests/unit-tests-Bridging-Header.h | Added a bridging header to expose target public headers to Swift. |
tests/unit-tests/IterableDataRegionObjCTests.m | Added an Objective-C test to ensure IterableDataRegion is accessible from Obj-C. |
swift-sdk/Core/Constants.swift | Converted IterableDataRegion from an enum to an @objc class for Obj-C compatibility. |
swift-sdk.xcodeproj/project.pbxproj | Updated project configuration to include new test files and proper bridging settings. |
LGTM! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…ive-C test
🔹 Jira Ticket(s)
✏️ Description
Fixed an issue where IterableDataRegion couldn't be accessed from Objective-C code because it was missing the required @objc annotation. This caused compilation errors in Objective-C projects trying to use the data region constants with the SDK.
Changes made: