I'm new at Swift, could anyone explain to me why I'm keep getting this problem. I'm using Xcode 6.4, but here is my question I hope I cleared it up but I needed my Function to takes in Large String then returns Tuple(numVowels, numConsonants) Count the number of words that start with consonants/vowels Return the Tuple and print the result of the function call. I did not need for it to count characters, only first character of each word. I create an for loop which will switch everything to lowercase. But now I'm stuck.
func count(string: String) -> (Vowels:Int, Consonants:Int) {
var Vowels = 0, Consonants = 0
for character in string {
switch String(character).lowercaseString {
case "a","e","i","o","u":
++Vowels
case "b","c","d","e","f","g","h","j","k","l","m","n","p","q","r","s","t","v","w","x","y","z":
++Consonants
default: break
}
}
return (Vowels, Consonants)
}