Swift is here and it's the future! Swift code is more maintainable and "safer" than Objective-C. If you're a serious app developer you know you need to upgrade your apps to the Swift language or risk being left behind. O2Swift automatically translates old Objective-C source code to Swift. It automates around ~95% of work when converting to the new Swift programming language. O2Swift can save you WEEKS of effort when converting Objective-C to Swift for significant projects! WARNING: You may need to spend some time to customize and optimize the conversion settings for your project. Some code blocks may require manual conversion. You should test every function of your converted code to make sure it works as expected. That said, we know the tool drastically reduces the time required for upgrading to Swift! The tool is highly sophisticated and customizable. You can customize type mappings from Objective-C to Swift as well as method mappings with an easy to use template system. Conversion is super fast is run directly on your Mac. Here are some of the translator features... -Translates Implementations/Interfaces to Classes -Translates Protocols to Interfaces -Translates @property to Swift properties -Translates frameworks like Foundation, UIKit, Quartz and others with correct method mappings and constants mappings. -Handles Optional "?" types with sophisticated type inference. -Converts init methods to constructors -Supports NSDictionary and NSArray @{... : ...} and @[...] literals. -Preserves formatting and comments inside your methods. -Converts blocks to Swift closures equivalents -Gathers type information from user specified header files to improve conversion. -Allows manual customization of generated code using @Converted, @Ported and @Porting annotations. -Supports code using ARC or manual memory management. If you're new to Swift you will find this tool very valuable as a aid for learning Swift if you have Objective-C experience.
Works Mostly
Well it's not perfect and the output swift is an older version of swift. That being said it did do most of the conversion. I did run into an issue but I followed the instructions and was able to work around it. I think that a person needs to keep in mind what is possible. A lot of Objc code is pretty garbage to begin with so when converting to swift you should not expect the result to be nicely refactored or anything but at least you do get swift code (albiet an older version swift 2 maybe I'm not sure). If I could request features/updates I would ask for: 1. updated swift code version output (swift 5 is latest at time of this review) 2. a copy/paste mode where I could simply paste some objc code in a window and copy out the result from the other window; like a split view Objc left side and swift ouput right side.
Worked perfect
Worked perfect converting some classes for testing from ObjC to Swift.
New Version error
I used the prior version with mixed success. But the new version seems to have a critical error. Clicking on the Source Directory or the Target Directory buttons does NOTHING. Before it brought up the standard window for selecting a file directory, now NOTHING. Plus when I attempt to rerun the conversion that previously ran, I get “Source directory cannot be found” even though I know it is there. At least this is what I am getting.
Failed to convert code with no useful information about why
Method: todaysPrayer: nullnull java.lang.StringIndexOutOfBoundsException: String index out of range: -1 No additional information was found to diagnose. No FAQ found. No useful documentation found. No Website (other than a YouTube video demonstrating a simple example). Great idea. Not very well implemented. I hope i can get my money back.
Subscribe our newsletter and get useful information every week.