Looking Through the Mirror
summary
Explains that Swift’s Mirror API enables runtime introspection and that Apple’s ArgumentParser depends on it; shows side‑by‑side print vs dump output, builds a concrete self‑loading plugin loader that auto‑initializes multiple SDKs by reflecting over properties and casting values, and demonstrates using Mirror to access private properties for unit tests and to generate request‑binding code like Retrofit. Notes the limitation: Mirror reads structure and values but cannot reliably write or mutate them.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 1:27Print dump vs jump in Swift
- 4:40Swift’s mirror introspection
- 7:31Self-loading plugins with mirror
- 12:46Accessing private properties
- 19:13Dynamic request syntax with annotations
- 24:52Runtime code generation
- 28:20Key takeaways and limitations of Swift mirrors








