Use "callback" or "handler" to name a closure in swift?

Viewed 2295

I am working on naming convention document at the moment. Some of our developers prefer to use "callback" to name a func's closure property. Some of them prefer "handler".

Which one is suggested by most developers or official Apple docs?

1 Answers

You forget that some people also just call it completion and Apple actually uses completionHandler such as here and here. Anyways I don't really think it matters what you call it. We all know what it is no matter how you name it. Just use completionHandler and point to the Apple docs if someone complains about it.

Related