Closed nlutsenko closed 7 years ago
@nlutsenko I saw your explaining about BFVoid
. But I'm not sure about this one :
"sending any message to BFVoid will result in a compile time error."
Do you mean [BFVoid continueWithBlock]
or [AnyBFTask<BFVoid> continueWithBlock]
?
Thanks for your answer first :)
Instead of returning a
BFTask
with no generic type, or a generic type of 'NSNull' when there is no usable result from a task, we use the type 'BFVoid', which will always have a value ofnil
.This allows you to provide a more enforced API contract to the caller, as sending any message to
BFVoid
will result in a compile time error.Thank you @richardjrossiii for this hack, it simplifies a lot of boilerplate. Also cc @gotemb as it would allow enforcing a lot of API contracts for you.