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
SwiftUI Performance 不要なViewの再描画と更新を抑える
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Hiroshi Hosoda
April 01, 2024
Programming
1
1.3k
SwiftUI Performance 不要なViewの再描画と更新を抑える
Hiroshi Hosoda
April 01, 2024
Tweet
Share
Other Decks in Programming
See All in Programming
CSC307 Lecture 08
javiergs
PRO
0
670
CSC307 Lecture 06
javiergs
PRO
0
690
Oxlintはいいぞ
yug1224
5
1.4k
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
180
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
5
800
CSC307 Lecture 03
javiergs
PRO
1
490
MUSUBIXとは
nahisaho
0
140
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
480
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
330
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
2.5k
生成AIを活用したソフトウェア開発ライフサイクル変革の現在値
hiroyukimori
PRO
0
110
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
140
Featured
See All Featured
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
54
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
750
How Software Deployment tools have changed in the past 20 years
geshan
0
32k
Thoughts on Productivity
jonyablonski
74
5k
AI: The stuff that nobody shows you
jnunemaker
PRO
2
280
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
110
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
350
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
77
Bash Introduction
62gerente
615
210k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
70
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
Transcript
© DMM © DMM CONFIDENTIAL SwiftUI Performance 不要なViewの再描画と更新を抑える
© DMM 自己紹介 • 細田大志 • 2019年 中途入社 • 動画配信開発部
• DMMTVの開発 2
© DMM 3 • Viewの再描画と更新の仕組み • Identity • Property •
Equatable • Viewの再描画と更新を抑える方法 • デバッグとInstruments アジェンダ
© DMM 4 • 再描画 • Viewを0から生成し直し表示する • ViewのIdentityが変化した場合 •
更新 • 必要なViewを更新して表示する • Viewのプロパティが変化した場合 Viewの再描画と更新
© DMM Identity SwiftUIはアプリの更新において同じか異なる要素かをIdentityによって認識 します。 SwiftUIには2種類のIdentityがあります。 • Explicit Identity •
Structural Identity 5
© DMM Explicit Identity 明示的な値によって管理されるIdentity。 6
© DMM Structural Identity View構造と型によって管理される 7
© DMM Property • @State • @StateObject • @ObservedObject •
@Binding • let • など 8
© DMM Equatable Viewが同値かによって更新するかを判定 9
© DMM 可能な限り分岐を統合する 可能な限りModifierを活用する 10
© DMM Viewには必要最低限な値を渡す プロパティが変更されると、View全体が更新される 11
© DMM Observation オブジェクトのプロパティをSwiftUIのViewが監視できるようになる。 12
© DMM Viewを分割する 複数のPropertyを持つViewのBodyを分割する 13
© DMM Viewを比較可能にする 14
© DMM ForEach ステーブルなidを使う 15
© DMM Debug • Self._printChanges • Viewが再描画または更新されるタイミングと要因を確認することができる • print(type(of: self.body))
• bodyの型情報を確認することができる 16
© DMM Instruments • Time Profiler • 実行された関数にかかった時間 • Hangs
• 応答していないメインスレッドを検 出し、対応するインターバルをハ ングの可能性があるものとしてラ ベル付けされる • View Body • 作成されたビューの数と作成にか かった時間 17
© DMM ご静聴ありがとうございました