//MARK: - Reverse every other word
var sampleSentence = "Hey my name is Chris, what is yours?"
func reverseWordsInSentence(sentence: String) -> String {
let allWords = sentence.components(separatedBy: " ")
var newSentence = ""
for word in allWords {
if newSentence != "" {
newSentence += " "
}
let reverseWord = String(word//.characters.reverse()) //Problem
newSentence += word
}
return newSentence
}
I made a tutorial by "Lets Build That App" on YouTube but his video is from 2016. He wrote it like you can see above but the characters function of the String doesn't exist!

newSentence += String(word.reversed())