Skip to content

Instantly share code, notes, and snippets.

View awedeebawe's full-sized avatar

Lyubomir Marinov awedeebawe

  • Eatglobe
  • Varna, Bulgaria
View GitHub Profile
@awedeebawe
awedeebawe / vowelSample.swift
Created December 3, 2017 14:17
"Test-Driven iOS Development with Swift 4"
func numberOfVowels(in string: String) -> Int {
let vowels: [Character] = ["a", "e", "i", "o", "u"]
/*
`characters` is deprecated
return string.characters.reduce(0) {
$0 + (vowels.contains($1) ? 1 : 0)
}
*/