Undo/Redo for drawing in iOS

I have found a solution for this, we need to create a array of array of DrawingPaths: – (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { // Do the above code, then [m_undoArray addObject:self.currentPath]; } – (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { [m_parentUndoArray addObject:[NSArray arrayWithArray:m_undoArray]]; } and then stroke the path in DrawRect.

How to Animate a UIBezierPath

I am not an expert on CoreAnimation but you can define a CABasicAnimation as follows CABasicAnimation *morph = [CABasicAnimation animationWithKeyPath:@”path”]; morph.duration = 5; morph.toValue = (id) [self getTrianglePath]; [maskLayer addAnimation:morph forKey:nil]; The first line states that you want to define an animation that changes the path property of the layer. The second line states that … Read more

SpriteKit’s SKPhysicsBody with polygon helper tool

I am looking for the exact same thing, as it turn out I have done a small web app for this purpose. SKPhysicsBody Path Generator as action in example: Update 2015-02-13: script <!DOCTYPE html> <html> <head> <meta charset=”UTF-8″> <title>SpriteKit Tools – SKPhysicsBody Path Generator</title> <link rel=”stylesheet” href=”https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css”> <style> /* disable responsive */ .container { max-width: … Read more