Tool to convert from Swift to objective-c

IosObjective CSwift

Ios Problem Overview


I know most of the questions are about converting from objective-c to swift, but I'm looking for a tool that can convert a swift code to objective-c. When searching all I find is objective-c to swift.

Yes - I know I can put swift code inside objective-c project with a bridge-header - that's not what I'm looking for.

I need a tool that converts swift code to objective-c code. Is there such thing?

Ios Solutions


Solution 1 - Ios

There is no such tools for converting Swift code to Objective-C. There are some reasons. One is because Objective-C is a semantic subset of Swift, i. e. Objective-C doesn't have any equivalent of some fundamental features of Swift such as Generics, Algebraic data types, Pattern matching and other. Theoretically it is possible to make, but generated Objective-C code should be boilerplate and inefficient.

It is recommended to migrate your codebase to Swift to avoid technical debt there are many tools which can be used to convert Objective-C to Swift.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questiondeveloper82View Question on Stackoverflow
Solution 1 - IosimnosovView Answer on Stackoverflow