Created
March 18, 2021 05:58
-
-
Save DavidPiper94/509914a260b251a5c207372402185c83 to your computer and use it in GitHub Desktop.
Example code for article about UndoManager - Command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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