Delegate pattern is one of the fundamental design patterns in Swift. Here's an example where Delegate is the most appropriate solution.
© Copyright Aleksandar Vacić, 2017 Creative Commons Attribution Share Alike 4.0.
This is material made to learn from. It's free to use and share, but please keep the attribution.