The new Swift is officially released and contains updates to the core language. It comes with more support in the form of general programming features and capabilities. It also comes with a series of minor lifts to Swift Package Manager and Foundation. Adding to that significantly are the changes done in stabilizing the ABI.
Let’s pick it one by one. The Swift-4.1-branch comes with tweaks and changes that will be continuously upgraded and updated with time.
The important dates include, October 18,2017, that is marked as a date for Initial Branching: Here, the Swift 4.1 Branch had been cut from the master branch to be released as a separate version entity. The updates were done every two weeks approximately. Final Branching was done on December 4, 2017.
After this date the process entered ‘bake’ period, where only critical changes were planned to be done. As announced, Swift 4.1 is released before the mid of the year 2018.
Let’s find out what all updates it comes with:
The latest Swift, adds more generic features to the language to offer more value in reference to the baseline development needs, adding to the goals of Swift Generics Manifesto. Here are the implementations from the release:
This allows you to have more number of smarter options to configure your builds, which includes a new code size optimization help and easy ways to specify which performance environment and platform support you prefer to go with.
Code Size Optimization Mode:
Now with this update you can optimize your codes to reduce their size. The best part is you can do this discreetly focusing on a particular part or cluster of code. This incredibly saves you on time.
Build Import Test:
By Import Test you are able to find out if a module or code group is importable or not. With this, swift developers are able to test different modules for their importability, putting the canImport() platform condition. The results are returned in the form of True or False and are basically based on the fact that whether the name of a module is present on all the platforms or not.
Also read: Swift vs Objective C: 5 Benefits of Swift Development
Target Environment Condition:
With the Target Environment Condition response status, you get to know if the code is compiled for a simulator. In case, it is already complied it will return ‘true’ value otherwise it will return ‘false’ value.
Foundation:
Now you have more helpful JSONEncoder and JSONDecoder classes that allow you to have new options and tactics for converting keys at the time of encoding and decoding.
There are a number of under-the-hood features in Swift 4.1 that are necessarily done to make the upcoming versions more stabilized with ABI. Here’s the list:
Swift Package Manager gets a couple of performance hikes in Swift 4.1. You can now see it correctly resolving package graph dependences with different URL schemes, like ssh and http. With this you can see a clear enhancement in performance for package graphs as you work with the new Swift Package Manager.
The first thing that makes it easy to migrate to Swift 4.1 is the fact that it is compatible with Swift 4.0. So, if you want to move to Swift 4.1 from earlier releases, you can use the code migrator offered by Apple’s Xcode 9.3 which will automatically handle the source changes and help you with smooth and easy migration. If you need any help, there’s a migration guide to help you go with the process easily.
You can go to Swift.org to have an access to the updated version of The Swift Programming Language for Swift 4.1 or you can even get to have it on Apple’s iBooks Store. Both will allow you to get it for free.
The platforms it is built on are Linux (Ubuntu 14.04, Ubuntu 16.04 and Ubuntu 16.10). Here’s the link to download.
A marketing graduate, a deemed strategist, a sure geek - Tushar is a fine blender of the art and science of writing. When it comes to tune up content with commerce, he knows the trick. For him, if words don’t make you think and beat, they are not worth your time. A crazy foodie, an unfailing jogger – that’s him off the desk!
Or send us an email at: [email protected]