As we've seen, the visitor pattern is a powerful design pattern that helps you write algorithms that are independent from the data they consume. The object structure stays untouched, whether arrays, dictionaries, trees, or even more complex structures, and each node or aggregate is enhanced with the Visitor object's capabilities.
Swift is particularly suitable for this design pattern, as we can leverage protocols and extensions, allowing the Visitor to be defined in completely different call sites.