<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Macros on Evan Coleman</title><link>https://edc.me/tags/macros/</link><description>Recent content in Macros on Evan Coleman</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 30 Dec 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://edc.me/tags/macros/index.xml" rel="self" type="application/rss+xml"/><item><title>Introducing MacroBrewery: A Collection of Swift Macros for Code Generation</title><link>https://edc.me/posts/introducing-macrobrewery/</link><pubDate>Tue, 30 Dec 2025 00:00:00 +0000</pubDate><guid>https://edc.me/posts/introducing-macrobrewery/</guid><description>&lt;p>If you&amp;rsquo;ve worked on a Swift codebase of any size, you&amp;rsquo;ve written the same boilerplate code hundreds of times. Memberwise initializers. Builder patterns. Enum case accessors. Test stubs. It&amp;rsquo;s tedious, error-prone, and frankly, boring.&lt;/p>
&lt;p>Swift 5.9 introduced macros, and I finally had a way to solve this properly. So I built &lt;a href="https://github.com/evandcoleman/MacroBrewery">MacroBrewery&lt;/a>, a collection of macros that generate the repetitive code I was tired of writing by hand.&lt;/p>
&lt;h2 id="whats-included">What&amp;rsquo;s Included&lt;/h2>
&lt;h3 id="autoinit">@AutoInit&lt;/h3>
&lt;p>Generates memberwise initializers that improve on Swift&amp;rsquo;s built-in one: optionals default to &lt;code>nil&lt;/code>, properties with default values preserve them as parameter defaults, and you can set any access level.&lt;/p></description></item></channel></rss>