Skip to content

Instantly share code, notes, and snippets.

@DavidPiper94
Created March 18, 2021 05:58
Show Gist options
  • Select an option

  • Save DavidPiper94/509914a260b251a5c207372402185c83 to your computer and use it in GitHub Desktop.

Select an option

Save DavidPiper94/509914a260b251a5c207372402185c83 to your computer and use it in GitHub Desktop.
Example code for article about UndoManager - Command
class Command {
var isUndone: Bool
let execute: () -> Void
let reverse: () -> Void
init(execute: @escaping () -> Void, reverse: @escaping () -> Void) {
isUndone = false
self.execute = execute
self.reverse = reverse
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment