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
速習iPhone Duo対応
Search
野瀬田 裕樹
September 18, 2026
Programming
1.1k
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
速習iPhone Duo対応
extension DC Day1用です
野瀬田 裕樹
September 18, 2026
Transcript
58 slides
速習iPhone Duo対応 合同会社DMM.com 野瀬田 裕樹(@ynoseda)
Speaker 野瀬田 裕樹(@ynoseda) 京都生まれ iOSがメインだけど Androidやったり たまにFlutterもやります
iPhone Duo、出ましたね
この登壇枠を申し込んだ時 サイドローディングの話とか 新規アプリでAI前提の設計で 色々やってることとか Swift 6.4の話とか 何話そうかなって色々 考えてたけどDuoで全部飛びました
ということで、 みんなでiPhone Duo対応 再チェックしましょう!
None
折り畳んだ状態の縦横 開いた状態の縦横 折り曲げた状態の縦横
10/23までに
iPhone Duoのこの6状態を 正常動作まで持っていかないと
😇
一つずつチェックしよう
1. デザインを理解する
None
HIG曰く
標準システムコンポーネントを使用し、 サイズ変更に対応するようにしてれば、 ほとんど調整することなく、 デバイスの向きに自動的に適応します
ほんまか?
いつもと位置が違うもの • タブバー • ツールバー • ナビゲーションバー • ステータスバー •
ライブアクティビティ
いつもと位置が違うもの • 開いた状態x横向き ナビゲーションバーがなくて 右側ツールバー上寄せ • 開いた状態x縦向き ステータスバーの位置が右上固定 • 同じアプリの例でも状態で色々違う
Safe Area • 縦向きなのに 左右にSafe Area
色々な開いた状態のUIパターン • Split View
色々な開いた状態のUIパターン • Split View • Sidebar
色々な開いた状態のUIパターン • Split View • Sidebar • コンテンツを2列表示に変更 etc
2. Duoに向けたデザイン対応
Xcodeのバージョンによる違い • Xcode 27未満:中央に小さく表示される • Xcode 27:Safe Areaを避けて表示される • Xcode
27.1:全画面に表示される
None
None
None
サイズクラス @Environment @Environment (\.horizontalSizeClass) (\.verticalSizeClass) outer display compact regular outer
display (横向き) compact compact inner display regular regular (縦向き)
Safe Area • ❌ view.safeAreaInsets.left * 2 • ✅ view.bounds.inset(by:
view.safeAreaInsets).width
角丸への対応 ConcentricRectangle()
独自UIで 折り目やカメラを避けたい
折り目・カメラ:予約済領域 • reservedRegionsでその領域を取ってきて避ける GeometryReader { proxy in let 折り目領域 =
proxy.reservedRegions(kind: .division) let 折り目が折り畳まなくても取れる = proxy.reservedRegions( kind: .division, options: .includeInactive ) let カメラ領域 = proxy.reservedRegions(kind: .occlusion) }
独自UIで横2列表現をしたい
ArrangementViewで横並び • 要素を2つに分割するレイアウトを組める(iOS 27.1+) NavigationStack { ArrangementView { Primary() }
secondary: { Secondary() } .arrangementViewStyle( .split ) } Primary Primary Secondary Secondary
ArrangementViewで横並び • 横向きだけで要素を2つに分割するレイアウトを組める(iOS 27.1+) NavigationStack { ArrangementView { Primary() }
secondary: { Secondary() } .arrangementViewStyle( .split.axes(.horizontal) ) } Primary Primary Secondary
ArrangementViewでoverlay • カスタムの重ね合わせレイアウトも組める(iOS 27.1+) // 重ね合わせているときのz方向のindexも取れる @Environment(\.overlayArrangementZIndex) private var zIndex
NavigationStack { ArrangementView { // 少し折り曲げた時はSecondaryが左半分に寄るから、 // Primaryを展開して表示したい、みたいなこともできる } Primary(zIndex > 0 ? .collapsed : .expanded) } secondary: { Secondary() } .arrangementViewStyle(.overlay) Secondary Primary
3. Duo特有の折り曲げに対応
ヒンジ(折りたたみ状態)の検知 struct InstrumentView: View { @State private var pitchBend: Double
= 0 var body: some View { GuitarView(pitchBend: pitchBend) .onHingeChange { _, context in if let hinge = context.hinge, hinge.status == .partiallyOpen { pitchBend = calculatePitchBend(angle: hinge.angle) } else { pitchBend = 0 } } } private func calculatePitchBend(angle: Angle) -> Double { ... } }
ヒンジ(折りたたみ状態)の検知 • onHingeChangeで折り畳みの状態の変化を検知できる • 引数のcontextからhingeの有無や折り畳み状態や角度が取れる
4. Duoのマルチシーンに対応
内側ディスプレイで2つのsceneが起動 • Duoは複数のアプリが 立ち上がる • 内側はマルチシーン対応だけど 外側はそうじゃないので注意 • 折り畳んだ状態で 新しいscene起動すると
失敗する
新しいsceneの起動の例 // 折り畳んで外側ディスプレイを使っている時のaction let alternate = UIAction(title: <#Alternate Action Title#>,
image: <#Alternate Action Image#>, handler: { _ in <#Perform Alternate Action#> }) // 新しいsceneを起動するaction let action = UIWindowScene.ActivationAction(alternate: alternate) { _ in let activity = NSUserActivity( activityType: <#Scene Activity Type#> ) return UIWindowScene.ActivationConfiguration(userActivity: activity) }
開いた状態で 外側のディスプレイも使いたい
Scene Accessory:カメラの例 struct CameraRootView: View { @State private var model
= Model() var body: some View { CameraView(model: model) .sceneAccessory { CameraCaptureAccessory { 外側ディスプレイに表示するView(model: model) } } } }
操作しないコンテンツ表示の例 struct RootView: View { var document: PresentationDocument var body:
some View { PresentationDocumentView(document: document) .sceneAccessory { ExternalNonInteractiveAccessory { PresentationPreview(document: document) } } } }
5. Vertical Controls
〜〜Barの位置変化に対応 • 左側のアプリは左側に 右側のアプリは右側に Controlsが縦に並ぶ
〜〜Barの位置変化に対応 • システム標準のものを使う NavigationStack { SomeView().toolbar { … } }
• ToolBarItemにはアイコンとテキストの両方を設定する Label("共有", systemImage: “square.and.arrow.up") → アイコンのみ/テキストのみ/両方表示をOSがよしなに切替する
toolbarだけど テキストボタンにしたい
axisBehaviorで水平方向に表示 .toolbar { ToolbarItem { SelectOrDoneButton() } .axisBehavior(.horizontalOnly) }
axisBehaviorで垂直方向に表示 .toolbar { ToolbarItem { 独自のCustomButton() } .axisBehavior(.verticalPreferred) // 独自のViewだけど縦に並べていいならこの指定もできる
} @Environment(\.toolbarVerticalEdge) private var 垂直軸上にtoolbarがあるかどうかも取れる
fl toolbarで …になる順番を決めたい (Over ow)
TabBarよりToolbarを残す
TabBarよりToolbarを残す TabView { Tab("Recents", systemImage: "clock") { ContentView() .toolbarVerticalCompressionBehavior( .prefersToolbarItems
// Toolbarが先に…になるデフォルト挙動を変えられる } } )
…を最後まで避ける要素を決める .toolbar { ToolbarItemGroup(placement: .primaryAction) { Button(〜〜) } .visibilityPriority(.high) //
.visibilityPriority(.low) 先に…に入る要素の指定も可 }
6. まとめ
やること • Xcode 27.1でビルドする • Size ClassとSafe Areaに対応してresizableにする • カスタムView関係に対応する(カスタムのtoolbarItemなど)
• Duoならではの表示に最適化する (2列表示、ヒンジ対応、折り曲げた状態でのUI調整など)
やっていきましょう
More Decks by 野瀬田 裕樹
See All by 野瀬田 裕樹
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
440
ネイティブiOSアプリだからできること
yuukiw00w
0
62
野瀬田とSwift愛好会
yuukiw00w
0
49
uhooiさん発ランダムタスクにチャレンジしよう!
yuukiw00w
1
93
ViewModelって200種類あんねん
yuukiw00w
0
72
Validate your App Intents adoption with AppIntentsTesting
yuukiw00w
0
69
App Intentsを実装しよう
yuukiw00w
0
73
iOS26時代の新規アプリ開発
yuukiw00w
0
290
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
430
Other Decks in Programming
See All in Programming
Claude Code ハーネスDeep Dive – 君はどこまで制御する? -
takateeen_knj
6
6.1k
オーケストレーション記述言語 Katari
yukikurage
0
270
例外からRich Errorsまで Kotlinエラーハンドリングの進化を読み解く
shiita0903
0
220
将来の標準フォーマッター?ktfmtを深堀る
t45k
0
220
私なりのハーネスエンジニアリング ~独自の言語処理系の開発を通して~
seosoft
0
220
Snowflake Openflow Connector利用の勘所 / 20261024developersio2026tokyo-snowflake-openflow
kasacchiful
PRO
0
350
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
130
社内AIエージェント「Askワンバン」における コストチューニングの取り組み
t0yohei
0
170
Kawaiicon: Kubernetes, it's no longer cool, but let's secure it anyway!
barnbarn
0
140
疎結合とは何か?ソフトウェア設計における結合バランスについて考える #phpcon_niigata
kajitack
2
320
作れるエンジニアから、価値を届けるエンジニアへ
ryunakayama
1
310
小さなアプリを作って公開するまで
onozaty
0
200
Featured
See All Featured
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
350
Testing 201, or: Great Expectations
jmmastey
46
8.4k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
320
The Cult of Friendly URLs
andyhume
79
7.1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
Test your architecture with Archunit
thirion
2
2.5k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.3k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.9k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
1k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
990
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
1
300
Principles of Awesome APIs and How to Build Them.
keavy
128
18k