Post

Replies

Boosts

Views

Activity

Reply to After manually adding a PKStroke, the UndoManager no longer works
I've filed a radar for this (FB7794075), but I've discovered a workaround in the mean time: self.undoManager?.groupsByEvent = false self.drawing.strokes.append(YOURCUSTOMPKSTROKE) for (index, _) in self.drawing.strokes.enumerated() {     self.undoManager?.beginUndoGrouping()     self.undoManager?.registerUndo(withTarget: self, handler: {         $0.drawing.strokes.remove(at: index)     })     self.undoManager?.endUndoGrouping() } self.undoManager?.groupsByEvent = true
Jul ’20