kentoh - Fotolia

Should Xcode 8 users migrate to Swift 3.0 or simply upgrade to 2.3?

Developers who use Xcode 8 have been faced with a choice: Make the jump to Swift 3.0 or simply upgrade to Swift 2.3. Here's what developers should consider when making the choice.

When Apple released the first version of Swift, they added a word of caution: They expected Swift to change dramatically. They were right.

Xcode 8 now comes with two versions of Swift: Swift 2.3 and Swift 3.0. The reason for this is simple: Apple made some significant, sweeping changes with 3.0. To make the upgrade easier, take this rule of thumb: If you have written a lot of Swift 2.0 code, migrate to Swift 2.3. But, if possible, jump to Swift 3.0.

Significant changes to Swift include the following:

  • All function parameters have labels by default.
  • Attribute arguments use a colon.
  • Line control statements use the #sourceLocation(file:line) syntax.
  • Dependencies have changed (check that frameworks you are using are upgraded to Swift 3.0 to support your projects).
Developers may want to jump to 3.0 sooner rather than later.

The changes may seem overwhelming, but it can be argued that they are worth applying to your projects because of the improved support and learning tools provided by Apple. For example, iPad users will see that there is a new Swift Playgrounds app as part of iOS 10. While Swift Playgrounds was designed to be used by schools to teach programming, it is also a great tool to brush up on your Swift skills and just have some fun.

If the jump to Swift 3.0 is too much, Swift 2.3 is a short-term solution to help adjust to the changes. However, developers may want to jump to 3.0 sooner rather than later. In addition to running faster code, developers who use Swift 3.0 will have access to new features in Xcode 8 and Apple training tools that will help teams get up to speed quickly.

Next Steps

Learn why Swift is a hit among mobile app developers

How will enterprises benefit from the Apple-SAP deal

Pros and cons of open source models

Dig Deeper on Mobile app development