Callbacks vs. Cloures - toant-dev/toandev.github.io GitHub Wiki
https://fxstudio.dev/delegates-vs-closure-callback/
Callback base pattern: Delegate Pattern, Closure Pattern
WHATS
- Breaking the retain cycle
- One to many relationships
- Datasources
- Scalability
- Enforcing the contract
CHOOSE
- You have a single callback => Closure
- Your callbacks are more like notifications => Delegate
- You need to become the delegate to multiple instances => Closure
- Your delegate is actually a datasource => Delegate
- Your have many callbacks, and they might change in the future => Delegate