Delegates & callbacks in Swift (part 2)

Introduction In the first part of this tutorial about delegation and callbacks, I had presented the delegation design pattern which is a communication design pattern between two objects based on one-to-one relation ship. We spoke about memory management and how Delegation pattern generates retain cycle and how we can resolve the issue using weak attribut. […]

Delegates & callbacks in Swift (part 1)

Introduction: CallBacks and Delegation are one of the often tools using by Swift developers. In this article, I try to explain the differences between them in point of view using and memory management. What is delegation? Delegation is a common design pattern where one class/struct delegates responsibility of implementing some functionality to another (the delegated class or struct). […]