-
Notifications
You must be signed in to change notification settings - Fork 722
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
Strings: Add support to generate Objective-C compatible Strings Swift code #489
Comments
lukaskukacka
added a commit
to lukaskukacka/SwiftGen
that referenced
this issue
Sep 7, 2018
lukaskukacka
added a commit
to lukaskukacka/SwiftGen
that referenced
this issue
Sep 28, 2018
lukaskukacka
added a commit
to lukaskukacka/SwiftGen
that referenced
this issue
Sep 28, 2018
djbe
changed the title
Add support to generate Objective-C compatible Strings Swift code
Strings: Add support to generate Objective-C compatible Strings Swift code
Jan 30, 2019
Closed
Is there any update on adding this PR as we have swift and objc code in one project |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I suggest to add a support for generating Objective-C compatible code Swift code for Strings. This would be valuable for mixed Objective-C / Swift projects.
Technical feasibility
To be Objective-C compatible, the template must generate
NSObject
subclass (instead of Swiftenum
with proper@objc
annotations.Solving nested classes not being available for Objective-C
Objective-C does not support Swift's nested classes. Only the root class is available in Objective-C by default.
This can be solved by providing custom class name for the nested classes using
@objc(ClassName)
expression. I suggest using simple namespacing scheme in form of camel-cased chaining ofParentChild
class names.Backwards compatibility
The change would be opt-in only via
objcCompatible
parameter to template, keeping 100% backwards compatibility with the current version.Relation to #376
Although this is similar to #376 "Generate ObjC source for .strings files", this suggestion is different. #376 generates Objective-C .h/.m files while this suggestion is to generate Swift code compatible with Objective-C.
I already have the PR ready and will open it as proposal soon. Creating the issue to follow the process and have it as base for discussion.
[EDIT] related PR is #490
The text was updated successfully, but these errors were encountered: