You can use Swift's built-in String function, which gets all the words in a string. This is better than just separating with a space (""), because you can have multiple words with a period (for example, the example below)
let str = "Apple watchOS 3 USA release date and feature Rumours."
var list = [String]()
str.enumerateSubstringsInRange(str.startIndex..<str.endIndex, options:.ByWords) {
(substring, substringRange, enclosingRange, value) in
//add to your array if lowercase != string original
if let _subString = substring where _subString.lowercaseString != _subString {
list.append(_subString)
}
}
source
share