Gagan_iOS
Gagan_iOS

Reputation: 4060

how to add undo manager for multiple UIView

I need some idea to how perform undo opertaion with UndoManager.

In my app user can add as many gifts (UIView) on a screen. He can rearrange & resize all added gifts on that screen.

For adding, rearranging & resizing gifts, I have made a subclass of UIView & in that class I have implemented code for the same operations on touch delegates.

Now my question is that if user has rearranged multiple gifts & also resize some of them, how I can implement a undomanager to restore all the gifts in original position.

Any idea or suggestion would be great at this time.

Upvotes: 1

Views: 484

Answers (1)

Santosh
Santosh

Reputation: 36

If you want to undo the change of position, size & rotation of UIViews, you need to hold the frame, transform of it when the gesture started. So that when perform undo, you can revert to the initial values.

You can refer this answer

Upvotes: 2

Related Questions