warning: 'withUnsafeBytes' is deprecated: use `withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R` instead let v4 = rawValue.withUnsafeBytes { (ptr: UnsafePointer<in_addr>) -> in_addr in
withUnsafeBytesがwarningでるのですがどうすれば直せますか?
swift
1public init?(_ rawValue: Data, _ interface: NWInterface? = nil) { 2 if rawValue.count != MemoryLayout<in_addr>.size { 3 return nil 4 } 5 let v4 = rawValue.withUnsafeBytes { (ptr: UnsafePointer<in_addr>) -> in_addr in 6 return ptr.pointee 7 } 8 self.init(v4, interface) 9 }

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。