-
Notifications
You must be signed in to change notification settings - Fork 20
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
Protocols with same name as class #213
Comments
I also reported this issue via email some time ago, but I didn't find a corresponding issue. I consider this high priority for us. |
@AlexanderJ Copying over the reply that I've sent you in https://swiftify.zendesk.com/agent/tickets/2538
|
This is unfortunately not always possible. One of the FW used here JSONModel requires that protocol and class have the same name. |
@AlexanderJ The case is understandable, but I don't see an easy or feasible solution here, unfortunately. Scanning of all headers may be implemented at some point in time, but only in the Offline Converter version, since sending all headers to the API would be too time and bandwidth-consuming. |
I don't think it would be necessary to transfer all the files. Scanning all files locally and transmitting only the information required to do the conversion correctly would suffice (e.g. just send the information that the class is available as protocol and as class). I don't think the code scanner is similar problematic to install on the customer site as the code converter. With this information you can translate NSArray and id as protocol and all other uses as class. That would at least compile. If I want to convert additional classes back to protocol I still have the option to do so manually. |
@AlexanderJ Understandable, although implementing this looks pretty complex compared to the other improvements, so unfortunately I cannot guarantee this will be completed anytime soon. |
If I use the same name for protocol and class in Objective-C (like many NS types, e.g. NSObject) the name of the protocol should get a Protocol suffix (Xcode also bridges objective-c protocols like that). This only applies if the code contains @protocol and @interface with the same exact name. Thus scanning all headers for this locally and sending the information to the translation is important.
Example: https://swiftify.me/lc8ui2
I would expect a Blub class and a BlubProtocol protocol.
The text was updated successfully, but these errors were encountered: