Swift Tip: OpaquePointer vs. UnsafePointer
When a struct
person
is completely defined in the header file, any pointers to it will be imported by Swift asUnsafePointer<person>
. This means we can also dereference the pointers, and look at the contents by calling.pointee
on the pointer.[…]
Because
account
is only in the [implementation] file, it’s called an opaque (or sometimes: incomplete) type: from the outside, we don’t know anything about it.