Yakov Manshin

Swift Macros Deep Dive (Part 2)

Write Your Own!

The second part of this Swift Macros Deep Dive covers the process of writing, testing, and debugging Swift macros in detail.

In the video, I solve three different tasks in BirdChat (my demo project) with the help of three different flavors of macros:

Besides, I demonstrate how you start from scratch and create a macros package, and how to debug and test the macros to make sure they work just as expected.

Also watch the first part where I explain why macros were added to Swift, how they work, how their flavors differ from each other, and—most importantly—how you can use them to make your code shorter and safer.