Updating my codebases to Swift 3

Apple officially released the first beta of Xcode 8 this past Monday, which includes Swift 2.3 (an updated version of the language to work with the new APIs on iOS 10 and macOS 10.12), and Swift 3, the latest big release for the language.

Swift 3 basically breaks your project. If you’re writing Swift and planning to continue doing so, my suggestion is: take the plunge right now and start migrating your project to Swift 3 right away.

That is, of course, providing you’ve got the time and the resources to do so.

In my case, I downloaded Xcode 8 and ran the migrator on a small project (about 1000 lines of Swift 2) with little success. The API changes that Swift 3 brings, such as removing namespaces, are big.

What I’m doing instead of trying to incrementally change my codebase (because the project wouldn’t even try to compile to show errors), is to update each part one by one on a new project, which eventually will replace my codebase.

It may not be the best route for everyone, specially if you’re dealing with large codebases.

This fall is shaping to be a busy one.

Esta entrada fue publicada en Uncategorized. Enlace permanente.