I had Xcode 8 convert my code to Swift 3. It changed all occruances of NSData to Data. In my Swift 2 code I had:
var data : NSData
var bytes = data.bytes
In Swift 3 I believe that I should be using withUnsafeMutbaleBytes and my code should looks somehting like:
var data : Data
var bytes = data.withUnsafeMutableBytes { (<#UnsafeMutablePointer<ContentType>#>) -> ResultType in
<#code#>
}
There isn't much documentation yet and I can't figure out how to properly use withUnsafeMutableBytes. Are there any examples of how to use withUnsafeMutableBytes?