My old code was:
let comps = split(str, { $0 == "-" || $0 == " " }, maxSplit: Int.max, allowEmptySlices: false)
after update of Swift 2 my XCode 7 fix it to:
let comps = split(str.characters, { $0 == "-" || $0 == " " }, maxSplit: Int.max, allowEmptySlices: false).map { String($0) }
but now I have an error: Cannot invoke 'map' with an argument list of type '((_) -> _)'
How to fix it.
The order of arguments for
split()
function messed up for some reason. It should be: