Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
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
600
Collection Views: Diffable Data Sources and Compositional Layout | Workshop @SwiftIsland 2019
hybridcattt
0
280
Detail-oriented UI with Layout Margins
hybridcattt
1
380
Flow Coordinators IRL
hybridcattt
0
190
SaaS- SDK as a service
hybridcattt
0
180
Other Decks in Technology
See All in Technology
一番人に近いコードレビューア CodeRabbit
kinopeee
0
110
かわいい身体と声を持つ そういうものに私はなりたい
yoshimura_datam
0
420
SREの仕事を自動化する際にやっておきたい5つのポイント
jacopen
6
970
AWS Amplify Conference 2026 - 仕様からリリースまで一気通貫生成 AI 時代のフルスタック開発
inariku
3
380
BPaaSオペレーション・kubell社内 n8n活用による効率化検証事例紹介
kubell_hr
0
250
re:Inventで見つけた「運用を捨てる」技術。
ezaki
1
140
re:Inventで出たインフラエンジニアが嬉しかったアップデート
nagisa53
4
200
AWS監視を「もっと楽する」ために
uechishingo
0
380
20260120 Amazon VPC のパブリックサブネットを無くしたい!
masaruogura
2
160
【Oracle Cloud ウェビナー】ランサムウェアが突く「侵入の隙」とバックアップの「死角」 ~ 過去の教訓に学ぶ — 侵入前提の防御とデータ保護 ~
oracle4engineer
PRO
2
210
Azure SRE Agent x PagerDutyによる近未来インシデント対応への期待 / The Future of Incident Response: Azure SRE Agent x PagerDuty
aeonpeople
0
150
Agentic Coding 実践ワークショップ
watany
39
26k
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
74
11k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
260
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
Paper Plane
katiecoart
PRO
0
46k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
220
[SF Ruby Conf 2025] Rails X
palkan
0
720
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
196
71k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.4k
A designer walks into a library…
pauljervisheath
210
24k
The SEO identity crisis: Don't let AI make you average
varn
0
56
Art, The Web, and Tiny UX
lynnandtonic
304
21k
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