When Apple released the first version of Swift, they added a word of caution: They expected Swift to change dramatically....
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
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).
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.
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 Microservices and mobile development
Related Q&A from Matthew David
In this article, mobile expert Matthew David walks developers through some of the most effective ways to connect to JSON APIs in an Android-based ...continue reading
Apple now supports two developmental languages. This means integrating JSON with iOS isn't as difficult as it might seem. Expert Matthew David ...continue reading
Microservices can offer flexibility for developers, but should they be using it for mobile development? Matthew David offers his take.continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.