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
iPhone X対応 ~Safe Areaの外側~
Search
akatsuki174
December 10, 2017
Programming
1k
0
Share
iPhone X対応 ~Safe Areaの外側~
2017/12/11 2017年 AKIBA.swift忘年回
akatsuki174
December 10, 2017
More Decks by akatsuki174
See All by akatsuki174
逆向きUIの世界 〜iOSアプリのRTL言語対応〜
akatsuki174
1
590
逆向きUIの世界〜AndroidアプリのRTL言語対応〜
akatsuki174
1
1.1k
私が変えてきたこと、変えなかったこと
akatsuki174
2
1k
最近読んでいる本-読書シェア会vol.1
akatsuki174
2
270
SwiftUI、UIKitでキャプチャを撮ろう!
akatsuki174
1
140
Appleにおけるプライバシーの全容を把握する
akatsuki174
0
6.2k
近年のAppleにおける位置情報とプライバシー
akatsuki174
3
510
オフライン勉強会ぼっち対策
akatsuki174
1
710
Xcode 15の新機能
akatsuki174
0
2.9k
Other Decks in Programming
See All in Programming
Symfony AI in Action - SymfonyLive Berlin 2026
chr_hertel
1
120
エラー処理の温故知新 / history of error handling technic
ryotanakaya
7
1.8k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
500
2026年のソフトウェア開発を考える(2026/05版) / Software Engineering Scrum Fest Niigata 2026 Edition
twada
PRO
21
11k
The Less-Told Story of Socket Timeouts
coe401_
3
970
cloudnative conference 2026 flyle
azihsoyn
0
110
PHPer、Cloudflare に引っ越す
suguruooki
1
140
Building on Bluesky's AT Protocol with Ruby
mackuba
0
100
JOAI2026 1st solution - heron0519 -
heron0519
0
180
実用!Hono RPC2026
yodaka
2
300
ローカルLLMでどこまでコードが書けるか / How much code can be written on a local LLM
kishida
2
310
サプライチェーン攻撃対策「層を重ねて落ちない壁」を10日間で組み上げた話 #TechLeadConf2026
kashewnuts
1
210
Featured
See All Featured
Abbi's Birthday
coloredviolet
2
7.4k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
290
Utilizing Notion as your number one productivity tool
mfonobong
4
300
For a Future-Friendly Web
brad_frost
183
10k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
530
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.7k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
160
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1.3k
First, design no harm
axbom
PRO
2
1.2k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
199
73k
Transcript
iPhone XରԠ ~Safe Areaͷ֎ଆ~ @akatsuki174
ࣗݾհ • ਢ౻ຘ • iOSΤϯδχΞ • Twitter, Qiita, SlideShare, Github,
SpeakerDeck →akatsuki174
1݄ޙʹvol.5 ։࠵༧ఆʂ
Έͳ͞ΜiPhone XରԠɺ ͪΖΜऴΘͬͯ·͢ΑͶʁ
ରԠγςϧ ରԠγςφΠ ѹత େը໘ ্Լʹ ࠇͯ͘ ͑ͳ͍ ෦͕ͬ
ɾͪΐͬͱ೦ͳؾ࣋ͪʹͳΔ ɾී௨ʹͪΐͬͱ͍ͮΒ͍ ɾ͜ͷձࣾɺiOSΞϓϦ։ൃʹྗೖΕͯͳ͍ ɹͷ͔ͳ…ͱࢥͬͯ͠·͏ ରԠͯ͠ͳ͍ΞϓϦͩͱ…
ͱ͍͏͜ͱͰ iPhone XରԠ͖͢ʂ
ͰඍົʹΫη͕͋Δ
iPhone XରԠΛ͢Δ্Ͱ͔ܽͤͳ͍ Safe AreaपΓͰ͍᪴ͨϙΠϯτͱ ͦͷղܾࡦʹ͍ͭͯ͠·͢ɻ ຊͷ
ɾGitHub https://github.com/akatsuki174/ OutsideSafeAreaLayout ɾQiita ޙiOSΞυϕϯτΧϨϯμʔʹͯެ։ ؔ࿈ࢿྉ
ɾWWDC2017Ͱొ ɾiOS11, Xcode9͔Β༻Մೳ ɾtopٴͼbottom layout guideͷ ɹdeprecatedԽͱೖΕସΘΓ ͓͞Β͍ɿSafe Areaͱ
͓͞Β͍ɿSafe Areaͱ https://developer.apple.com/documentation/uikit/uiview/ positioning_content_relative_to_the_safe_area
ࠓճ࣮ݱ͔ͨͬͨ͜͠ͱ ɾը໘Լ෦ʹ্ԼΞχϝʔγϣϯ ɹ͢ΔviewηοτΛஔ͘ ɾviewηοτͷपลͷܠ؍Λ ɹཚ͞ͳ͍ ※ҎԼɺΞχϝʔγϣϯ͢Δviewͷ ηοτͷ͜ͱΛMenuViewͱݺͼ·͢
͖᪴ϙΠϯτ̍ MenuView͕ Home IndicatorͱඃΔ
None
ͲΜͳ࣮ʹͳ͍͔ͬͯͨ Safe Areaͷbottomʹରͯ͠Ͱͳ͘ SuperviewʢViewController.viewʣͷ bottomʹର੍ͯ͠Λ͚͍ͯͨ
Ͳ͏࣮Λม͔͑ͨ Safe Area͕͑ΔΜͳΒͦͷbottomΛ औ੍ͬͯΛ͚Δɻ ͑ͳ͍ͳΒࠓ·Ͱ௨Γ
͖᪴ϙΠϯτ̎ viewͷԼʹtable viewͷ༰͕ νϥݟ͑͢Δ
εΫϩʔϧ͢Δͱ৺ͳ͔͠ ͕νΧνΧ͢Δ
ͲΜͳ࣮ʹͳ͍͔ͬͯͨ SafeAreaͷbottomʹରͯ͠Ͱͳ͘Superview ʢViewControllerͷviewʣͷbottomʹରͯ͠ ੍Λ͔͚͍ͯͨ
Ͳ͏࣮Λม͔͑ͨ Safe Areaͷbottomʹର੍ͯ͠Λ ͚ΔΑ͏ʹͨ͠
݁Ռ ViewControllerͷviewͷ എܠ৭͕MenuViewͷԼʹ ݟ͑ΔΑ͏ʹͳͬͨɻ
͖᪴ϙΠϯτ̏ MenuViewΛϑϧͰ දࣔ͠ͳ͍࣌ʹ͔ͬ͜ѱ͍
ԫ৭͍෦ʹίϯςϯπ͕ දࣔ͞Ε͍ͯΔͱࢥͬͯ Լ͍͞… ඍົ͡Όͳ͍Ͱ͔͢ʁ
Ͳ͏࣮Λม͔͑ͨ ʮˢˣʯϘλϯ͕λοϓ͞Εͨ࣌ʹ Ξχϝʔγϣϯͭͭ͠alphaΛมߋ
͜ΕͰ
͓·͚
ɾಈతͳ੍Λ͔͚͍ͯΔηϧͷ ɹϨΠΞτ͕Safe AreaͷڥքۙͰ ɹ͏ʹΐ͏ʹΐಈ͘ ɾiPhone XҎ֎Կͳ͘ಈ͘ ɹʢͦΕΏ͑ؾͮ͘ͷΕͨʣ ͜Μͳঢ়͕ग़ͨ͜ͱ
֘ͷcell.xibͷviewΛ બ͠ɺSafe Area Layout Guideͷ νΣοΫϘοΫεΛ ֎͢͜ͱͰղܾͨ͠ ղܾࡦ
ɾϨΠΞτʹؔΘΔ࣮Λͨ࣌͠ ɹඞͣiPhone XͰ֬ೝ͢Δ ɾͳΜ͔͓͔͍͠ͱࢥͬͨΒSafe Area ɹLayout GuideͷνΣοΫϘοΫεΛ ɹ֎ͯ͠ΈΔ ɾSafe Areaͷ֎ଆ͕ͲͷΑ͏ͳදࣔʹ
ɹͳ͍ͬͯΔ͖͔ߟ͑Δ iPhone XରԠͷίπ
͝ਗ਼ௌ͋Γ͕ͱ͏ ͍͟͝·ͨ͠ʂ