Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
SwiftUI Performance 不要なViewの再描画と更新を抑える
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Hiroshi Hosoda
April 01, 2024
Programming
1.5k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
SwiftUI Performance 不要なViewの再描画と更新を抑える
Hiroshi Hosoda
April 01, 2024
Other Decks in Programming
See All in Programming
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
1k
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
170
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
5.2k
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
0
450
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
180
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
150
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
2
630
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
220
Domain-Driven Transformation
hschwentner
2
2.3k
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
590
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
270
Featured
See All Featured
Abbi's Birthday
coloredviolet
4
10k
Visualization
eitanlees
153
17k
Faster Mobile Websites
deanohume
310
32k
A designer walks into a library…
pauljervisheath
211
25k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
The Cost Of JavaScript in 2023
addyosmani
55
10k
WCS-LA-2024
lcolladotor
0
890
Evolving SEO for Evolving Search Engines
ryanjones
0
330
Paper Plane (Part 1)
katiecoart
PRO
2
12k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
640
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1k
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
870
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 ご静聴ありがとうございました