Dmytro Pylypenko
Posted on January 28, 2019
Swift 5 is ABI stable, which gives direct compatibility with OS without additional layers and backward compatibility between different versions of Swift, beginning from 5.0 version.
Also the new version has a lot of improvements:
-
Raw strings
Gives one of the possibility to write a string without escaping characters inside. It's very feature for writing raw RegEx expressions in a clean way.If you need to embed a variable inside a raw string, you must add hash symbol after backslash:
#"(\\|\#(variable))"#
String interpolation
Declaration can be flexible and behave on your own.
For this, extend the protocolStringInterpolation
with own function:
No recursion inside computed properties
Avoid additional layer for computations, and have it inside a closure.
It was a part of described features, more is there: https://developer.apple.com/documentation/xcode_release_notes/xcode_10_2_beta_release_notes/swift_5_release_notes_for_xcode_10_2_beta
Article on Medium: https://medium.com/@dimpiax/swift-5-what-is-new-examples-fbb64d525486
Posted on January 28, 2019
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
August 25, 2020