Rodrigo Maximo
Apr 29, 2022

Hey! Thank you for the great words and feedback!

About your points:
1. The protocol Persistence is the same existing on the first snippet. We did not intend to change it, since in this example we’re only worried about breaking the responsibilities of Square through creating new protocols. The Persistence protocol is only a helper to exemplify a complex persistence implementation, that would indeed save the object in memory, files, UserDefaults, etc

2. The save method is not from the SquarePersitence protocol, but from the Persistence. That’s the reason :)

Rodrigo Maximo
Rodrigo Maximo

Written by Rodrigo Maximo

Lead Mobile Engineer at Nubank |  iOS Engineer

Responses (1)