Skip to content

Instantly share code, notes, and snippets.

@DomiR
Created December 21, 2015 17:19
Show Gist options
  • Save DomiR/1e347ed525625cd84c84 to your computer and use it in GitHub Desktop.
Save DomiR/1e347ed525625cd84c84 to your computer and use it in GitHub Desktop.
Array->Pointer->Array
var initalArray = [1, 2, 3]
let pointer: UnsafeMutablePointer<Int> = UnsafeMutablePointer(initalArray)
let arrary = Array(UnsafeBufferPointer(start: pointer, count: initalArray.count))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment