How to do it...

In the last recipe, we added a method to our Person class to save it to a remote database. This is a very useful functionality, and as we add more and more features to our app, we will likely have more types where we will want to save instances of that type to a remote database. Let's create a protocol to define how we will interface with anything that can be saved in this way:

protocol Saveable {
var saveNeeded: Bool { get set }
func saveToRemoteDatabase(handler: @escaping (Bool) -> Void)
}