Create endless cgpath without framedrops
问题 I need to create a cgpath continuously. At the moment I do it like that: func createLine(){ var rand = randomBetweenNumbers(1, 2) currentY-- if rand < 1.5{ currentX-- CGPathAddLineToPoint(leftPath, nil, currentX, currentY) }else{ currentX++ CGPathAddLineToPoint(leftPath, nil, currentX, currentY) } CGPathAddLineToPoint(rightPath, nil, currentX+tileSize, currentY) lineNode.path = leftPath rightNode.path = rightPath } And call it like that: NSTimer.scheduledTimerWithTimeInterval(0.05, target: