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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Marina Vatmakhter
April 08, 2022
Technology
260
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
620
Collection Views: Diffable Data Sources and Compositional Layout | Workshop @SwiftIsland 2019
hybridcattt
0
300
Detail-oriented UI with Layout Margins
hybridcattt
1
420
Flow Coordinators IRL
hybridcattt
0
230
SaaS- SDK as a service
hybridcattt
0
220
Other Decks in Technology
See All in Technology
はじめてのDatabricks:技術者向けワークショップ / beginner-workshop
databricksjapan
PRO
0
150
GuardDuty 検知対応を DevOps Agent で効率化しようとしている話 / GuardDuty Investigations with DevOps Agent
masahirokawahara
1
300
DGX Sparkを2台使って いろいろ動かす話
sonoda_mj
1
130
AI時代に、プロダクトの数だけ積み上がる所有コストをどうエンジニアリングするか / Engineering the Cost of Ownership
kzkmaeda
0
990
[RSJ26] AnoleVLA: Lightweight Vision-Language-Action Model with Deep State Space Models for Mobile Manipulation
keio_smilab
PRO
0
120
Guerilla InnerSource in enterprises, during the AI hype
onenashev
PRO
0
150
Beyond the Hype: Practical AI for Your Oracle Database with MCP
thatjeffsmith
1
250
20260903 Tokyo Jazug Night #62 | Azure エンジニアよ、 その環境は本当にセキュアか?
olivia_0707
1
610
[RSJ26] Building a VLA Model Based on Self-Distilled Classification
keio_smilab
PRO
0
190
AIエージェントの開発・提供におけるセキュリティリスクの論点と対策
flatt_security
1
570
Self Healing Rollouts: Automating Production Fixes with Agentic AI
kdubois
0
150
PdMをやめて、 "プロダクトビルダー"という 働き方に変えました / PdM to Product Builder
shikichee
2
710
Featured
See All Featured
AI: The stuff that nobody shows you
jnunemaker
PRO
9
970
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
370
How to Ace a Technical Interview
jacobian
281
24k
Ethics towards AI in product and experience design
skipperchong
2
360
Statistics for Hackers
jakevdp
799
230k
The agentic SEO stack - context over prompts
schlessera
0
890
Balancing Empowerment & Direction
lara
6
1.3k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
410
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
4
570
We Are The Robots
honzajavorek
0
330
Stop Working from a Prison Cell
hatefulcrawdad
274
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