PragmaticBookshelf

PragmaticBookshelf

Devtalk Sponsor

The Case of the Vanishing Bodies (PragProg)

An introduction to the magic of freestanding and attached Swift Macros.

Daniel H Steinberg

The Case of the Vanishing Bodies is an introduction to the magic of freestanding and attached Swift Macros. You’ll learn to create a variety of macros. You’ll get a feel for when you should and shouldn’t create them, which sort of macro you should create, and how to use SwiftSyntax to implement them.

There’s a fair amount of boilerplate code involved in so many of our everyday tasks as Swift programmers. Until Xcode 15, every time we created a new SwiftUI View we had to create the corresponding preview code. The struct and computed property weren’t interesting in any way - they were just a necessary task we needed to perform to display a preview of our View. With the introduction of the #Preview macro, we now only need to provide the code required to create an instance of the view being displayed.

In this book you’ll learn to create a variety of macros. You’ll get a feel for when you should and shouldn’t create them, which sort of macro you should create, and how to use SwiftSyntax to implement them. Your macros will accept parameters when appropriate and will always include tests. You’ll even learn to create helpful diagnostics for your macros and even FixIts.


Daniel H Steinberg is the author of more than a dozen books including the best selling books A Functional Programming Kickstart, A SwiftUI Kickstart, A Swift Kickstart, Second Edition, and Dear Elena. 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.

Daniel presents iOS, Functional Programming, SwiftUI, and Swift training and consults through his company Dim Sum Thinking. 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. Details on his training and speaking are on the Dim Sum Thinking website.


Don’t forget you can get 35% off with your Devtalk discount! Just use the coupon code “devtalk.com" at checkout :+1:

Where Next?

Popular Backend topics Top

PragmaticBookshelf
Property-based testing helps you create better, more solid tests with little code. Use the PropEr framework in both Erlang and Elixir, to...
New
PragmaticBookshelf
Elixir's straightforward syntax and this guided tour give you a clean, simple path to learn modern functional programming techniques. Exp...
New
PragmaticBookshelf
Drowning in unnecessary complexity, unmanaged state, and tangles of spaghetti code? Clojure cuts through complexity by providing a set of...
New
PragmaticBookshelf
Learn Elixir from this fast-paced book—first published with Groxio's Programmer Passport—from the author of Seven Languages in Seven Week...
New
PragmaticBookshelf
Write effective and useful tests with the Mockito framework. Distinguish between mocks, stubs, and spies, and feel confident about when a...
New
PragmaticBookshelf
Programming Ruby is the most complete book on Ruby, covering both the language itself and the standard library as well as commonly used t...
New
PragmaticBookshelf
Give your Rail's apps an instant performance boost by harnessing the power of efficient, manageable, and sustainable background processin...
New
PragmaticBookshelf
Shave countless hours off development time with production-ready Go recipes. Learn language nuances while doing common (and not so common...
New
PragmaticBookshelf
Build fast, scalable PostgreSQL and Rails apps. Solve data growth, quality, and reliability challenges, for workloads from consumer Inter...
New
PragmaticBookshelf
Dive into extraordinary and robust home automation projects written in Go. Deploy, host, and maintain code in your home lab using best of...
New

Other popular topics Top

siddhant3030
I’m thinking of buying a monitor that I can rotate to use as a vertical monitor? Also, I want to know if someone is using it for program...
New
DevotionGeo
I know that -t flag is used along with -i flag for getting an interactive shell. But I cannot digest what the man page for docker run com...
New
AstonJ
We have a thread about the keyboards we have, but what about nice keyboards we come across that we want? If you have seen any that look n...
New
AstonJ
I ended up cancelling my Moonlander order as I think it’s just going to be a bit too bulky for me. I think the Planck and the Preonic (o...
New
AstonJ
This looks like a stunning keycap set :orange_heart: A LEGENDARY KEYBOARD LIVES ON When you bought an Apple Macintosh computer in the e...
New
PragmaticBookshelf
Build highly interactive applications without ever leaving Elixir, the way the experts do. Let LiveView take care of performance, scalabi...
New
AstonJ
We’ve talked about his book briefly here but it is quickly becoming obsolete - so he’s decided to create a series of 7 podcasts, the firs...
New
New
New
PragmaticBookshelf
Author Spotlight: Karl Stolley @karlstolley Logic! Rhetoric! Prag! Wow, what a combination. In this spotlight, we sit down with Karl ...
New