Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Demystifying SwiftUI Previews
Search
Marina Vatmakhter
April 08, 2022
Technology
0
220
Demystifying SwiftUI Previews
Understand how SwiftUI previews work, why they pause, and how to fix it.
Marina Vatmakhter
April 08, 2022
Tweet
Share
More Decks by Marina Vatmakhter
See All by Marina Vatmakhter
Bug-Free by Design: Crafting Swift Code That Doesn't Sting
hybridcattt
0
140
Detail-oriented UI with Layout Margins @NSSpain 2019
hybridcattt
2
580
Collection Views: Diffable Data Sources and Compositional Layout | Workshop @SwiftIsland 2019
hybridcattt
0
270
Detail-oriented UI with Layout Margins
hybridcattt
1
360
Flow Coordinators IRL
hybridcattt
0
180
SaaS- SDK as a service
hybridcattt
0
170
Other Decks in Technology
See All in Technology
生成AIを利用するだけでなく、投資できる組織へ / Becoming an Organization That Invests in GenAI
kaminashi
0
110
AWS re:Invent 2025で見たGrafana最新機能の紹介
hamadakoji
0
420
Amazon Bedrock Knowledge Bases × メタデータ活用で実現する検証可能な RAG 設計
tomoaki25
2
230
エンジニアリングをやめたくないので問い続ける
estie
2
1.2k
WordPress は終わったのか ~今のWordPress の制作手法ってなにがあんねん?~ / Is WordPress Over? How We Build with WordPress Today
tbshiki
2
820
Database イノベーショントークを振り返る/reinvent-2025-database-innovation-talk-recap
emiki
0
230
MLflowダイエット大作戦
lycorptech_jp
PRO
1
140
[デモです] NotebookLM で作ったスライドの例
kongmingstrap
0
160
30分であなたをOmniのファンにしてみせます~分析画面のクリック操作をそのままコード化できるAI-ReadyなBIツール~
sagara
0
180
Microsoft Agent 365 についてゆっくりじっくり理解する!
skmkzyk
0
380
AI-DLCを現場にインストールしてみた:プロトタイプ開発で分かったこと・やめたこと
recruitengineers
PRO
2
160
ウェルネス SaaS × AI、1,000万ユーザーを支える 業界特化 AI プロダクト開発への道のり
hacomono
PRO
0
150
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
95
14k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.8k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.3k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
180
Automating Front-end Workflow
addyosmani
1371
200k
Navigating Weather and Climate Data
rabernat
0
42
30 Presentation Tips
portentint
PRO
1
160
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
81
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.2k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
Transcript
Demystifying SwiftUI previews Marina Gornostaeva | @hybridcattt
Agenda ! Other use-cases " Preview lifecycle # The build
process $ How live reloading works ⏸ Reduce previews pausing
! Other use-cases
! Other use-cases
" Lifecycle of a SwiftUI preview • Build once •
Live reload on changes • Pause if change is unsupported by live reloading • Repeat
# Build process • For DEBUG • Detect by ENABLE_PREVIEWS
build setting • Use ProcessInfo in runtime
$ Dynamic replacement • Swift feature called @_dynamicReplacement • Pitched
in 2018 • Supports changes in implementation of a function, computed variable, initializer or subscript struct MyStruct { dynamic func x() { print("x") } } extension MyStruct { @_dynamicReplacement(for: x()) func y() { print("y - replaced dynamically") } }
$ Limitations of live reloading • It’s applied to everything
in the current ile • Supported: changes to bodies of functions, properties, initializers • Not supported: • Editing comments • Signature changes • Adding/removing types, functions, properties • Initial value changes • Changes in other iles
⏸ Improving live reloading • Use computed vars • Check
build scripts • Auto-resume previews
Thanks & @hybridcattt https://hybridcattt.com/blog/ ixing-swiftui-previews