What’s New in Swift 5? | raywenderlich.com

Swift 5 is finally available in Xcode 10.2! This release brings ABI stability and improves the language with some long-awaited features. See what’s new!


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/55728-what-s-new-in-swift-5
1 Like

I enjoyed the tutorial. BTW: the company where I first started working would often send the newbie engineer looking for a (verbalize) “I” “D” ten “T” bolt (or screw, or part…) in the parts bin (or warehouse, etc). I’d send them to Amazon these days since they would be required to type it out. Your new character properties example brought back old memories.

@ferguson Really glad you liked it! Cheers! :]

@shogunkaramazov, I didn’t understand the usage of ##. It looks like the same result is produced even #. Below is my test and it works fine

let hashtag1 = ##“You can use the Swift “hashtag” #swift in Swift 5.”##
let hashtag2 = #“You can use the Swift “hashtag” #swift in Swift 5.”#

print(hashtag1)
print(hashtag2)
print(hashtag1 == hashtag2) // produces true.

Please do let me know what is the need for ##.

It’s needed when you have something inside the string that looks like going to end the string prematurely.

// below won't work
let hashtag2broken = #"You can use the Swift "hashtag"#swift in Swift 5."#
//                                                    ^ this seems to close the string

// must use multiple of #: ##, ###, ####, or more would work
let hashtag2 = ##"You can use the Swift "hashtag"#swift in Swift 5."##

This tutorial is more than six months old so questions are no longer supported at the moment for it. Thank you!