~/talk

Swift Macros: The Key to Efficient and Elegant Code

Talkat Swift Connection 2023 · 2023-09-21..09-22· [swift]
links:none on file
slides:none on file

A custom SecureURL macro is built as a freestanding expression that returns URL and enforces that the literal starts with https, emitting a compiler diagnostic when it does not. Implementation uses the SwiftSyntax dependency and requires unit tests plus breakpoints to debug the syntax tree. Demo compiles into a SwiftUI app, tests pass, but builds cost minutes and tests are brittle to formatting; macro generation and the error diagnostics work as shown.

AI-written summary · about

  1. 0:00Introduction
  2. 1:24What are Swift macros
  3. 3:38Types of Swift macros
  4. 6:05Building a macro
  5. 11:13Creating a secure URL macro
  6. 24:38Shortcomings of macros
  7. 28:53Recap and resources
  8. 31:24Q&A
~/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.