Quiver of arrows

When Apple released the beta of the newest version of its IDE Xcode 8 in June 2016, they released a beta update of Swift 3 along with it—the newest, open-source iteration of the Swift mobile programming language. If you have an existing iOS app or are currently in development, your first question with any iOS update is probably “How will this affect my app? Do I need to update my code—and how quickly?”

The short answer: If you can budget the time and resources to migrate your code to Swift 3, now is the time to do it. Read on to learn more about what’s new with the language, reasons why you should consider migrating now, and tips on getting started.

How Swift Disrupted the Objective-C Status Quo

If Swift is still new to you, take a minute to read our article, Swift vs. Objective-C: A Look at iOS Programming Languages to get caught up. What you should know about Swift is that it’s a newer, streamlined language that Apple designed to better align with the platform’s evolving hardware and software. It allows more rapid development by enabling developers to be more productive. It requires less code, has better readability, and is prone to fewer errors than its predecessors. Swift has been widely embraced since 2014, showing significant growth from 2015 to 2016 (mirroring the decline in popularity of Objective-C), effectively bringing iOS programming languages up to par with the rest of the platform’s advancements.

Swift represents the direction that iOS has been headed for a while. If you haven’t migrated over yet, the Swift 3 iteration is a pivotal point and a great opportunity to make the change.

Migrating to Swift 3: Not without its challenges.

How critical is it to migrate existing code to Swift 3? Apple emphasizes that it’s definitely time to get on board—especially if you want to take advantage of all the new features in Xcode 8. This is the version that most closely aligns with the future of iOS development—migrating code from previous versions now will help you future-proof your app.

Xcode 8 has a Swift Migration Assistant and a quick pre-migration checklist to get you started, but note that the task of migrating to Swift 3.0 (or the interim update, 2.3) can be a difficult, labor-intensive task—development teams across the web have documented their struggles with the process on their blogs, so it’s important be adequately prepared before you jump in. While Apple says that migration can theoretically take minutes, teams should budget multiple days for in case issues arise.

Expect that the migration tool will necessitate some work to fix compiler errors after migration—it’s not 100% error-free, but Apple has compiled a list of known migration errors to help you through.

What about Swift 2.3?

Swift 2.3 was an interim update to the Swift language that you may or may not have already upgraded to. Apple’s reason for creating it was specific: It allowed developers to work within the newest software development kits (SDKs) at the time, those built for updated operating systems like Sierra, iOS 10, tvOS 10, and watchOS. Depending on the maturity of your project and how close you are to release, you may opt to migrate to 2.3 (this can be done with the Migration Assistant, too), or keep your code in Swift 2.3 for now (it’s compatible with Xcode 8), but there are a few things to bear in mind if you do:

  1. For now, you’ll be able to submit apps written in both Swift 2.3 and Swift 3 to the App Store with Xcode 8.
  2. However, Apple states that “Swift 2.3 and Swift 3 are not binary compatible so your app’s entire code base needs to pick one version of Swift.” This is essentially Apple’s line in the sand—meaning, you should update to Swift 3, and now’s the time to do it.
  3. Any documentation is limited to Swift 3.
  4. You won’t be able to use Playgrounds with Swift 2.3, or the Playgrounds app for iPad, an iPad app that teaches core coding in Swift.

To learn more about programming with Swift, there’s no better resource than Apple’s Swift blog, and Swift’s open-source site where you can get both Mac and Linux versions and access to public repositories for its compiler, LLDB debugger and REPL, standard and core libraries, package manager, and more. For more technical differences in Swift 3, watch this 3-part series.

Ready to make the move to Swift 3? Consult a freelance Swift developer on Upwork to help you migrate your iOS development project over to the latest and greatest today.

Your API Strategy & Why You Need One Now

Your API Strategy & Why You Need One Now

Download Today