What\'s a simple implementation of the following NSString category method that returns the number of words in self, where words are separated by an
NSString
self
Swift 3:
let words: [Any] = (string.components(separatedBy: " ")) let count = words.count