SCNGeometryElement setup in Swift 3
<p>I bit the bullet and started converting my app to Swift 3. As always, the converter leaves very much to be desired. In this case, I'm not sure how to properly code the new version. Here is the original:</p>

<pre><code>let indexes : [CInt] = [0,1,2,3]
let dat  = NSData(bytes: indexes, length: sizeofValue(indexes))
let ele = SCNGeometryElement(data:dat, primitiveType: .Triangles, primitiveCount: 2, bytesPerIndex: sizeof(Int))
</code></pre>

<p>After running the conversion and writing a new sizeof (thanks), I ended up with this:</p>

<pre><code>let indexes : [CInt] = [0,1,2,3]
let dat  = Data(bytes: UnsafePointer&lt;UInt8&gt;(indexes), count: sizeof(indexes))
let ele = SCNGeometryElement(data:dat, primitiveType: .triangles, primitiveCount: 2, bytesPerIndex: MemoryLayout&lt;Int&gt;.size)
</code></pre>

<p>However, this gives me (on the <code>Data(bytes:length:)</code> call):</p>

<blockquote>
  <p>'init' is unavailable: use 'withMemoryRebound(to:capacity:_)' to temporarily view memory as another layout-compatible type.</p>
</blockquote>

<p>I've looked over a few threads here, and read the release notes that cover this, and I'm still baffled what I'm supposed to do here.</p>