undoCount
The number of times you can invoke undo before there are no actions left to undo.
Declaration
var undoCount: Int { get }Discussion
A nonzero value doesn’t imply you can safely invoke undo() immediately, because you may have to close open undo groups first.