https://www.raywenderlich.com/7181017-unsafe-swift-using-pointers-and-interacting-with-c?utm_campaign=rw-weekly-issue-255&utm_medium=email&utm_source=rw-weekly

Full access to the largest collection of Swift and iOS development tutorials anywhere!
In this tutorial, you’ll learn how to use unsafe Swift to directly access memory through a variety of pointer types.

By Brody Eller
Feb 3 2020 · Article (30 mins) · Intermediate
<aside> 💡 Update note: Brody Eller updated this tutorial for Swift 5.1. Ray Fix wrote the original.
</aside>
By default, Swift is memory safe: It prevents direct access to memory and makes sure you’ve initialized everything before you use it. The key phrase is “by default.” You can also use unsafe Swift, which lets you access memory directly through pointers.
This tutorial will take you on a whirlwind tour of the so-called unsafe features of Swift.
Unsafe doesn’t mean dangerously bad code that might not work. Instead, it refers to code that needs extra care because it limits how the compiler can protect you from making mistakes.
These features are useful if you interoperate with an unsafe language such as C, need to gain additional runtime performance or simply want to explore the internals of Swift. In this tutorial, you’ll learn how to use pointers and interact with the memory system directly.
<aside> 💡 Note: While this is an advanced topic, you’ll be able to follow along if you have reasonable competency in Swift. If you need to brush up on your skills, please check out our iOS and Swift for Beginners series. C experience is beneficial but not necessary.
</aside>