After I convert from swift 2 to swift 3, an error appears for the below line
let value = UnsafePointer<UInt32>(array1).pointee
'init' is not available: use 'withMemoryRebound (to: capacity: _)' to temporarily view memory as another type of mock compatible.
in swift2 it looks like
let value = UnsafePointer<UInt32>(array1).memory
Can someone explain please? Sorry, I'm pretty new to swift3
After making changes to
let abc = UnsafePointer<UInt32>(array1).withMemoryRebound(to: <#T##T.Type#>, capacity: <#T##Int#>, <#T##body: (UnsafeMutablePointer<T>) throws -> Result##(UnsafeMutablePointer<T>) throws -> Result#>)
but still, what value should be included in the variable? Sorry, I have a search around, but too bad I can not find a solution
source
share