Answers by @alex_p and @mixel are correct, but it's also possible to do it with Swift split
function:
let time = "7:30"
let components = time.characters.split { $0 == ":" } .map { (x) -> Int in return Int(String(x))! }
let hours = components[0]
let minutes = components[1]