What method do I call to find the number of spaces in a string in Swift? I want to loop through that number, something like this:
@IBOutlet weak var stack: U
let title = "A sample string to test with." let count = title.componentsSeparatedByString(" ").count - 1 print(count) // 5