You have a few methods with SKAction that could likely achieve what you want :
SKAction performSelector: onTarget:
and
SKAction waitForDuration:
If you subclass a SKShapeNode you can utilize those two methods in a SKAction sequence
to draw the line over time.
You will of course need to manually calculate the new location to draw to each iteration and determine if the line is completed and end the drawing over time process.
Definitely interested if anyone has another way to achieve this functionality via SpriteKit, but if not, this should work.
Sorry, don't have time to code this, but the logic should get you there.
UPDATE :
I thought of another option which I personally think is a bit easier.
- Calculate the angle between origin point and end point.
- Calculate the distance from origin point and end point.
- create a shape node of circle or a pixel even. Think of it as your pencil point you will be drawing with.
- rotate the shape node so that it is angled towards the end point - using the angle you calculated.
- Create a SKAction that scales the width of your shape node based on the distance you calculated.
- run the SKAction.
This seems relatively easy, but you could still subclass if you wanted to make it more flexible, like adding color parameters etc.