I'm writing this very simple completion handler, but then now I have this error in my case saying :
error: '>' is not a prefix unary operator
I looked here but that doesn't seem to answer my question. I added space between the operator and 5 but still it didn't work. I'm sure the fix is simple but I couldn't figure it out. All other cases for Ints I've seen had a range, but this is just a comparison
func completeTasks(number: Int, completionHandler : (_ flag : Bool) -> () ){
switch number {
case <5 :
completionHandler(true)
case >5 :
completionHandler(false)
default:
fatalError()
}
}
completeTasks(number: 10){ result in print(result)
}