moqod / ios-scratch-n-see

The project provides en effect when the user swipes the finger over one texture and by swiping reveals the texture underneath it. The effect can be applied for scratch-card action or wiping a misted glass.
421 stars 104 forks source link

Undo / Redo - Question (no error) #6

Closed thomasSailing closed 9 years ago

thomasSailing commented 10 years ago

Question 1: Question 1: I would like some help - how can I integrate an undo / redo? ... Question 2: With faster movement, the erased line has not soft curves img_0288

Jnis commented 9 years ago

We updated library with your suggestion into question 2. Regarding Question 1: i believe you can do next: 1/ add subclass from MDScratchImageView 2/ catch and save all TOUCHes for this view (touchesBegan and touchesMoved) note: do not forget call super for each of this 3/ when you want UNDO, you need: