DrawingOperationStack
public class DrawingOperationStack
Store and manage the undo/redo stack for a drawing
-
You may set a custom delegate for
DrawingOperationStackif you want to know when undo/redo are available in realtime. The core framework does not use this delegate.Declaration
Swift
public weak var delegate: DrawingOperationStackDelegate? -
Declaration
Swift
public var canUndo: Bool { get } -
Declaration
Swift
public var canRedo: Bool { get } -
You may inspect the raw values in the undo stack in order to do fancy-pants things like coalesce operations together.
Declaration
Swift
public private(set) var undoStack: [DrawingOperation] { get } -
Add an operation to the stack
Declaration
Swift
public func apply(operation: DrawingOperation) -
Undo the latest operation, if any
Declaration
Swift
@objc public func undo() -
Redo the most recently undone operation, if any
Declaration
Swift
@objc public func redo() -
Clear the redo stack
Declaration
Swift
@objc public func clearRedoStack()
View on GitHub
DrawingOperationStack Class Reference