Skip to content

Instantly share code, notes, and snippets.

@fitomad
Created April 23, 2019 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fitomad/19ac395e5ce1ac41ffc930d01e150a39 to your computer and use it in GitHub Desktop.
Save fitomad/19ac395e5ce1ac41ffc930d01e150a39 to your computer and use it in GitHub Desktop.
public protocol Originator
{
/**
Crea un *snapshot* del modelo en un momento
en concreto.
*/
func createMemento() -> Memento
/**
Restaura el modelo a partir de un *snapshot*
*/
mutating func restore(from memento: Memento) -> Void
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment