I have a problem that I can't understand, I have completion handler that returns Void?
_ completionHandler: @escaping ((Int) -> Void?)
and when I use it like this:
service.getItems({ val in
row.hidden = Condition.init(booleanLiteral: val == 0)
row.evaluateHidden()
})
xCode is showing an
Missing return in a closure expected to return 'Void?'
so I have to add
return nil
What is more, if I have only 1 line in closure I dont need to return (I'm assuming it treats that 1 line as return). Whats the point of returning nil in closure that returns nullable void? Is this a bug or some kind of swift feature I don't undertand?