CGPath not working in Swift 3
<p>I am updating code for swift 3. I have created a custom path for my spritekit object that works in swift 2. However, now I get a compiler error: </p>

<blockquote>
  <p>Nil is not compatible with expected argument type 'Unsafe Pointer CGAffineTransform'</p>
</blockquote>

<pre><code>let offsetX = player.size.width * player.anchorPoint.x
let offsetY = player.size.height * player.anchorPoint.y

let path = CGMutablePath()

CGPathMoveToPoint(path, nil, 10 - offsetX, 16 - offsetY)
CGPathAddLineToPoint(path, nil, 10 - offsetX, 0 - offsetY)
CGPathAddLineToPoint(path, nil, 24 - offsetX, 0 - offsetY)
CGPathAddLineToPoint(path, nil, 24 - offsetX, 16 - offsetY)
CGPathAddLineToPoint(path, nil, 24 - offsetX, 16 - offsetY)
CGPathAddLineToPoint(path, nil, 28 - offsetX, 40 - offsetY)
CGPathAddLineToPoint(path, nil, 18 - offsetX, 46 - offsetY)
CGPathAddLineToPoint(path, nil, 6 - offsetX, 36 - offsetY)
CGPathAddLineToPoint(path, nil, 6 - offsetX, 18 - offsetY)



path.closeSubpath()
</code></pre>

<p>The error is for passing nil in the second argument when adding to the path. I attempted to pass in an unsafe pointer as so:</p>

<pre><code>var tr = CGAffineTransform.identity
CGPathMoveToPoint(path, &amp;tr, 10 - offsetX, 16 - offsetY)
....
</code></pre>

<p>but then got another strange error.</p>

<blockquote>
  <p>CGPathMoveToPoint is unavailable. Use move(to: transform:)</p>
</blockquote>

<p>However, there was no move function with argument name to. There was a move(toParent: ) however.</p>