Undoing and Redoing NSView Object Move Made by NSPanGestureRecognizer
问题 I am working on a sample desktop application to test the UndoManager class, which I don't often get to use. Anyway, the following is the idea. I create two NSView sub view objects (red & blue). They are added to an IBOutlet-connected NSView object (panView). I add the pan gesture ( NSPanGestureRecognizer ) to these two sub view objects. The applications calls the undo manager when the user moves either sub view object. The following is my entire code from top to bottom. import Cocoa class