With Swift 3 leaning towards Data
instead of [UInt8]
, I\'m trying to ferret out what the most efficient/idiomatic way to encode/decode swifts vario
You can get an unsafe pointer to mutable objects by using withUnsafePointer:
withUnsafePointer(&input) { /* $0 is your pointer */ }
I don't know of a way to get one for immutable objects, because the inout operator only works on mutable objects.
This is demonstrated in the answer that you've linked to.