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
UIKitにSwiftUIを埋め込んだら 罠にハマった話
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Hayate Kuronuma
May 12, 2026
Programming
16
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
UIKitにSwiftUIを埋め込んだら 罠にハマった話
Hayate Kuronuma
May 12, 2026
More Decks by Hayate Kuronuma
See All by Hayate Kuronuma
本番だけWebViewが500エラーになる
hayatekuronuma
0
56
ユーザー価値を届け続けるために、ウォンテッドリーが大切にしている文化
hayatekuronuma
0
9
Other Decks in Programming
See All in Programming
Railsバージョンを4倍にした話
optim
0
1k
Event is what happens
moro
2
4.1k
Distance field of Julia set
kinakomoti321
0
310
Apple Intelligenceとオンデバイス時代の到来
yahir0
0
240
オーケストレーション記述言語 Katari
yukikurage
0
250
느린 네트워크와 저사양 디바이스 사용자를 위한 웹뷰 로딩 시간 개선기
kmkim
1
220
仕様駆動開発入門 (何を作るかを先に決めて渡す) | 目指せ Kiro マスター 05
inariku
PRO
2
120
Rails初心者がパスキーを実装してみて大変だったこと
ktombow
0
160
AmebaブログはKMPから卒業します
kmars0605
0
340
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
2k
graphql-ruby を Spinel で速くしようとした話
mtsmfm
0
140
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
330
Featured
See All Featured
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.3k
Tell your own story through comics
letsgokoyo
1
1.1k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
The browser strikes back
jonoalderson
0
1.9k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Side Projects
sachag
456
43k
The SEO Collaboration Effect
kristinabergwall1
1
620
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
530
GraphQLとの向き合い方2022年版
quramy
50
15k
Bash Introduction
62gerente
615
220k
Transcript
© 2026 Wantedly, Inc. UIKitにSwiftUIを埋め込んだら 罠にハマった話 #24 Mobile勉強会 ウォンテッドリー ×
チームラボ × Sansan Apr.21 2026 - Hayate Kuronuma
© 2026 Wantedly, Inc. 名前:黒沼 疾風 入社日:2025.09 ポジション:iOSエンジニア 性格診断:コントリビューター 自己紹介
hayate_k_eng
© 2026 Wantedly, Inc. 01 やったこと 02 起きた不具合 03 原因
04 修正と教訓 目次
© 2026 Wantedly, Inc. やったこと 01
© 2026 Wantedly, Inc. UIKitベースの応募モーダルに、 SwiftUIのチェックボタン群を 埋め込んだ • UIHostingController で
ラップ • 親子関係を定義: addChild → addSubview UIKitの画面にSwift UIを部分導入
© 2026 Wantedly, Inc. 同一モーダル内で複数 Sceneを切り替えて表示している UIKitの画面にSwift UIを部分導入 options loading
completed
© 2026 Wantedly, Inc. 1. モーダル内の Viewを全て非表示 2. 対象のSceneだけ表示 UIKitの画面にSwift
UIを部分導入 Control Logic isHidden = true / false で制御
© 2026 Wantedly, Inc. 起きた不具合 02
© 2026 Wantedly, Inc. プレミアムプランユーザーは応募後にメッセージ送信をすることができる 前提
© 2026 Wantedly, Inc. プレミアムユーザーが メッセージを入力出来なくなった! (キーボードの表示にとても時間がかかるようになった)
© 2026 Wantedly, Inc. 原因 03
© 2026 Wantedly, Inc. 起きていたこと CPU負荷:高 メッセージ入力画面において、 CPU負荷が 高まっている メソッドの呼び出し回数
viewDidLayoutSubviews() 約57,000回 の異常な呼び出しを検知
© 2026 Wantedly, Inc. 仮説:キーボード表示がトリガー? キーボードなし viewDidLayoutSubviews は1回だけになった キーボードあり 57,000回のレイアウトループが発生
結論:キーボード表示がトリガーだった
© 2026 Wantedly, Inc. レイアウトループの流れ 1. メッセージ入力モーダルでキーボード表示 2. キーボード表示時のレイアウト調整で layoutIfNeeded()を実行
3. Viewのレイアウト更新が走る 4. isHiddenで隠していたUIHostingViewがレイアウト更新対象になる 5. UIHostingViewがさらにレイアウト更新を要求しているよう(ブラックボックス)
© 2026 Wantedly, Inc. 修正と教訓 04
© 2026 Wantedly, Inc. HostingControllerをViewから完全に削除 レイアウトループの原因となっていた UIHostingControllerを整理し、Viewから完全に削除 表示された🙌
© 2026 Wantedly, Inc. 表示しないHostingViewは removeしよう 教訓・まとめ isHiddenで隠しても、View階層に残ったUIHostingControllerが レイアウトループの原因になりうるケースがある
© 2026 Wantedly, Inc.
© 2026 Wantedly, Inc. ご清聴ありがとうございました!