Different challenge

I have tried to apply some of the learnings from prior chapters to sheets and I am having trouble using an undo manager in sheets. My thinking was to have an undo for setting the die call;

private dynamic var rolls: Int = 10 { willSet { let undo: NSUndoManager = undoManager! ..... more undo code } }
But the trouble is that “fatal error: unexpectedly found nil while unwrapping an Optional value” when running code, relating to unwrapping undoManager

Is it possible to use undo manager within a sheet?

Thanks
Paul

Hi all,
I worked it out; I need to use let undo = window!.undoManager!
Thanks
Paul