Question

I am developing an IOS app. I need a functionality that includes undo and reset. It seems quite simple to perform an undo on the last operation. However I can't find any built in support for resting to the first stored undo operation.

My question is, how can I pop the first undo action and reset my view accordingly? Thank you

Was it helpful?

Solution

Depending on what you're doing, the implementation might be different, but the documentation for NSUndoManager can be found here.

If you just want to undo the last group of actions, call undoNestedGroup.

If you want to undo everything, you could make a while loop that tested canUndo, and if that returned YES, called undo.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top