~/talk

Getting the most from Swift Macros

Talkat ServerSide.swift 2024 · 2024-09-26..09-27· [typescript, software-architecture]
slides:none on file

Shows how Swift 5.9 macros replace boilerplate with concrete examples: the #preview macro that generates a PreviewProvider struct, a freestanding SF symbols enum macro that parses string literal arguments via SwiftSyntaxBuilder, emits diagnostics for invalid names, and is covered by XCTest unit tests. Demonstrates attached macros (member, accessor, peer, member-attribute), the peer+accessor combo that makes a published backing property, and using SwiftSyntaxExplorer to inspect nodes.

AI-written summary · about

  1. 0:00Introduction to Swift macros
  2. 2:03Understanding macro structure
  3. 4:20Designing a custom macro
  4. 7:07Creating the macro package
  5. 10:53Working with SwiftSyntax
  6. 13:52Implementing diagnostics
  7. 17:13Macro testing
  8. 18:26Advanced macro types
  9. 25:02Advanced macro techniques
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.