Swift Memory Dumping
This is far from normal or sane Swift code, but it works and the results are really useful. It’s also a great example of how Swift lets you interact with all sorts of low-level C calls without much more of a fuss than it takes to call them from C. Although you should probably avoid these shenanigans when you can, the fact that you can do stuff like
unsafeBitCast
and get pointers to the internal storage of arrays is really handy when you need it.