‘withUnsafeBytes’ is deprecated: use ‘withUnsafeBytes(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R’ instead

在编写 Swift 代码的时候,执行如下代码的时候:

出现如下警告:

修正警告的方式,参考使用如下代码:

参考链接