I am trying to convert the string:
let time = \"7:30\"
to integers:
let hour : Int = 7 let minutes : Int = 30
You can split string by : character and then convert results to Int:
:
let timeStringArray = time.componentsSeparatedByString(":") if timeStringArray.count == 2 { hour = timeStringArray[0].toInt minutes = timeStringArray[1].toInt() }