PRO TIP

The swiftest way to Swift

Convert Objective-C source code to Swift with a click.

Do you have Objective-C source code you need to convert to Swift 4.1 or 4.2? Swiftify can pull this off with a simple single click.

Install the Swiftify for Xcode extension from the Mac App Store to see a new Swiftify submenu in Xcode’s Editor menu. To ensure it’s enabled, visit System Preferences > Extensions and tick Xcode Source Editor under Swiftify for Xcode.

Here you’ll find three options: Convert Selection to Swift, Convert File to Swift, Paste as Swift. And the names pretty much say it all when it comes to their functionality.

Swiftify also has a Finder extension that you access by Control-clicking on a folder, ZIP file or project/source file, then selecting a conversion type from the contextual menu.

The Swiftify Xcode extension in action. Note the handy shortcut key for the Paste as Swift option.

Introduced after the initial public release of Swift, Swiftify’s converter has come a long way. It now handles complex conversion issues, with full block and closure support, class hierarchy support and a deep understanding of data types and many complex Objective-C constructs.

If you’ve got an Objective-C code base, Swiftify is a must-have for your toolkit. And even if you already work exclusively in Swift, Swiftify is still handy for converting the Objective-C sample code you come across online.