Daniel Tull: Notes

Sunday, 19 April 2020

Articles

Books

Videos

Code

Converting between values and data using the raw bytes of the value. Martin R has some caveats and much more detail on Stack Overflow.

let inDate = Date()
let data = withUnsafeBytes(of: inDate) { Data($0) }
let outDate = data.withUnsafeBytes { $0.load(as: Date.self) }