Introduction to Swift Macros
Daniel H Steinberg
We'll see an example that eliminates boilerplate code in the use of AsyncStreams. Throughout the day we look at various situations in which macros might and might not be appropriate to help you get a feel for when you should reach for this tool.
We examine the different types of macros that are available in Swift and have actual examples of why it's important to select the appropriate type. We'll consider what's involved in basic parsing before digging into parsing an Abstract Syntax Tree using SwiftSyntax to pull out the pieces you need for your macro. We put in error handling and write tests to make our macros more robust.
Outline
Daniel H Steinberg
Daniel presents iOS, SwiftUI, and Swift training and consults through his company Dim Sum Thinking.
He has written apps for the iPhone and the iPad since the SDKs first appeared and has written programs for the Mac all the way back to System 7. When he's not coding or talking about coding for the Mac, the iPhone, and the iPad he's probably cooking, baking bread, or hanging out with friends.
Information on his books and videos is available on the Editors Cut website. Details on his training, and speaking is on the Dim Sum Thinking website.