$30 off During Our Annual Pro Sale. View Details »
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
590
Collection Views: Diffable Data Sources and Compositional Layout | Workshop @SwiftIsland 2019
hybridcattt
0
270
Detail-oriented UI with Layout Margins
hybridcattt
1
370
Flow Coordinators IRL
hybridcattt
0
180
SaaS- SDK as a service
hybridcattt
0
180
Other Decks in Technology
See All in Technology
Oracle Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
1
380
Snowflake導入から1年、LayerXのデータ活用の現在 / One Year into Snowflake: How LayerX Uses Data Today
civitaspo
0
2.2k
アプリにAIを正しく組み込むための アーキテクチャ── 国産LLMの現実と実践
kohju
0
200
特別捜査官等研修会
nomizone
0
540
Knowledge Work の AI Backend
kworkdev
PRO
0
130
TED_modeki_共創ラボ_20251203.pdf
iotcomjpadmin
0
130
100以上の新規コネクタ提供を可能にしたアーキテクチャ
ooyukioo
0
230
たまに起きる外部サービスの障害に備えたり備えなかったりする話
egmc
0
390
20251218_AIを活用した開発生産性向上の全社的な取り組みの進め方について / How to proceed with company-wide initiatives to improve development productivity using AI
yayoi_dd
0
620
AI時代のワークフロー設計〜Durable Functions / Step Functions / Strands Agents を添えて〜
yakumo
3
1.9k
AWS re:Invent 2025 re:Cap LT大会 データベース好きが語る re:Invent 2025 データベースアップデート/セッションの紹介
coldairflow
0
160
Identity Management for Agentic AI 解説
fujie
0
390
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
310
Prompt Engineering for Job Search
mfonobong
0
120
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
25
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
2
250
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
290
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
680
Ethics towards AI in product and experience design
skipperchong
1
140
Fireside Chat
paigeccino
41
3.8k
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