UIBezierPath Removal Issue
问题 I am trying to make a game where a ball is bouncing off a user drawn line. The code for drawing the line is included below and works fine but how would I remove the line once the ball makes contact with it or the player draws a new line? path = [UIBezierPath bezierPath]; // Start Coords of Line [path moveToPoint:CGPointMake(pos2x, pos2y)]; [path addLineToPoint:CGPointMake(pos1x, pos1y)]; // End Coords of Line CAShapeLayer *shapeLayer = [CAShapeLayer layer]; shapeLayer.path = [path CGPath];