How to convert array to UnsafeMutablePointer<UnsafeRawPointer?> Swift 3.0?
<p>Here was my workable code in the previous version of Swift:</p>

<pre><code> let imageOptionsDictKeys = [ kCVPixelBufferPixelFormatTypeKey, kCVPixelBufferWidthKey,  kCVPixelBufferHeightKey, kCVPixelBufferOpenGLESCompatibilityKey, kCVPixelBufferIOSurfacePropertiesKey]
 let imageOptionsDictValues = [ cvPixelFormatType,  frameW, frameH, boolYES]

 var keyCallbacks = kCFTypeDictionaryKeyCallBacks
 var valueCallbacks = kCFTypeDictionaryValueCallBacks

 let imageOptions = CFDictionaryCreate(kCFAllocatorDefault, UnsafeMutablePointer(imageOptionsDictKeys), UnsafeMutablePointer(imageOptionsDictValues), 4, &amp;keyCallbacks, &amp;valueCallbacks)
</code></pre>

<p>After changes in the Swift 3.0 I have to convert my keys and values arrays into <code>UnsafeMutablePointer&lt;UnsafeRawPointer?&gt;</code> for creating CFDictionary.</p>

<p>This way:</p>

<pre><code>    let imageOptionsDictKeysPointer =  UnsafeMutablePointer&lt;UnsafeRawPointer?&gt;.allocate(capacity: 1)
    imageOptionsDictKeysPointer.initialize(to: imageOptionsDictKeys)
</code></pre>

<p>gives an Bad Access error.</p>

<p>And after reading documentation I am trying to compile this code:</p>

<pre><code>        let imageOptionsDictKeys = [kCVPixelBufferPixelFormatTypeKey, kCVPixelBufferWidthKey,  kCVPixelBufferHeightKey, kCVPixelBufferOpenGLESCompatibilityKey]
        let imageOptionsDictKeysRawPointer = Unmanaged.passUnretained(imageOptionsDictKeys).toOpaque()
        let imageOptionsDictKeysPointer =  UnsafeMutablePointer&lt;UnsafeRawPointer?&gt;.allocate(capacity: 1)
        imageOptionsDictKeysPointer.initialize(to: imageOptionsDictKeysRawPointer)

        let imageOptionsDictValues = [ cvPixelFormatType,  frameW, frameH, boolYES]
        let imageOptionsDictValuesRawPointer = Unmanaged.passUnretained(imageOptionsDictValues).toOpaque()
        let imageOptionsDictValuesPointer =  UnsafeMutablePointer&lt;UnsafeRawPointer?&gt;.allocate(capacity: 1)
        imageOptionsDictValuesPointer.initialize(to: imageOptionsDictValuesRawPointer)

        let imageOptions = CFDictionaryCreate(kCFAllocatorDefault, imageOptionsDictKeysPointer, imageOptionsDictValuesPointer, 4, &amp;keyCallbacks, &amp;valueCallbacks)
</code></pre>

<p>but error  <strong>Generic parameter 'Instance' could not be inferred</strong> appears in the lines <strong>Unmanaged.passUnretained(<em>array</em>).toOpaque()</strong></p>

<p>I have no idea how to create CFDictionary programmatically now.</p>