Until Swift 2 I used this extension to remove multiple whitespaces:
func condenseWhitespace() -> String { let components = self.componentsSeparatedByC
SWIFT 3: Cleaner version
extension String { var condensedWhitespace: String { let components = self.components(separatedBy: .whitespacesAndNewlines) return components.filter { !$0.isEmpty }.joined(separator: " ") } }