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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Marina Vatmakhter
April 08, 2022
Technology
250
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Demystifying SwiftUI Previews
Understand how SwiftUI previews work, why they pause, and how to fix it.
Marina Vatmakhter
April 08, 2022
More Decks by Marina Vatmakhter
See All by Marina Vatmakhter
Bug-Free by Design: Crafting Swift Code That Doesn't Sting
hybridcattt
0
160
Detail-oriented UI with Layout Margins @NSSpain 2019
hybridcattt
2
610
Collection Views: Diffable Data Sources and Compositional Layout | Workshop @SwiftIsland 2019
hybridcattt
0
300
Detail-oriented UI with Layout Margins
hybridcattt
1
400
Flow Coordinators IRL
hybridcattt
0
210
SaaS- SDK as a service
hybridcattt
0
200
Other Decks in Technology
See All in Technology
入門!AWS Blocks
ysuzuki
1
110
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
2.9k
AmazonRoute 53ではじめてのドメイン取得!HTTPS化までの道のりを整理してみた
usanchuu
3
140
protovalidate-es を導入してみた
bengo4com
0
180
AIネイティブな開発のサプライチェーンリスク対策 〜激動の開発現場でリスクに立ち向かう〜【ZennFes】
cscengineer
PRO
2
110
フロンティアAIのゲート化と地政学リスク
nagatsu
0
130
なぜ Platform Engineering の土台に Kubernetes を選ぶのか
r4ynode
2
620
2026TECHFRESH畢業分享會 - Lightning Talk - 打造精準高效的 MCP 設計模式與測試實務
line_developers_tw
PRO
0
940
AIはどのように 組織のアジリティを変えるのか?
junki
2
670
"何を作るか"を任される エンジニアは、どう育つのか
yutaokafuji
1
660
Oracle AI Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
6
2k
2026TECHFRESH畢業分享會 - 原生還是跨平台? App 開發踩坑實錄
line_developers_tw
PRO
0
940
Featured
See All Featured
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
200
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
200
Six Lessons from altMBA
skipperchong
29
4.3k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
280
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.1k
How to Talk to Developers About Accessibility
jct
2
230
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
320
The Art of Programming - Codeland 2020
erikaheidi
57
14k
RailsConf 2023
tenderlove
30
1.5k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
570
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