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
Many enterprises still rely heavily on consumer-grade mobile applications, but making your own may not be as complex as you think. Here are three ...continue reading
There are several platforms available for creating apps for improving the driving experience. Expert Matthew David discusses why it may be easier ...continue reading
As the mobile industry is maturing, so is the way apps are being designed. Learn about the latest tools and software updates to help support and ...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.