You can re-write it like this:
let result = randomIV.withUnsafeMutableBytes {(bufPointer: UnsafeMutableRawBufferPointer) in
SecRandomCopyBytes(kSecRandomDefault, bufPointer.count, bufPointer.baseAddress!)
}
Or a little more simply:
let result = randomIV.withUnsafeMutableBytes {
SecRandomCopyBytes(kSecRandomDefault, $0.count, $0.baseAddress!)
}
Topic:
Programming Languages
SubTopic:
Swift
Tags: