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
iOSアプリのレイアウトを回転で変更するとき注意していること
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
kazuhiro4949
December 28, 2018
Technology
810
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
iOSアプリのレイアウトを回転で変更するとき注意していること
Nagoya iOS meetup vol. 5
https://nagoya-ios-meetup.connpass.com/event/110046/
kazuhiro4949
December 28, 2018
More Decks by kazuhiro4949
See All by kazuhiro4949
SwiftUIをUIKitのライフサイクルで拡張するTips
kazuhiro4949
4
2.9k
iOS15でプッシュ通知のテストが大変だった話
kazuhiro4949
0
670
Source Editor Extensionと SwiftSyntaxでコード自動生成ツール を作る
kazuhiro4949
2
5k
iOS 12サポート終了で使えるAPIおさらい
kazuhiro4949
2
410
Source Editor ExtensionとSwiftSyntaxでコード自動生成
kazuhiro4949
0
140
大企業の最前線でコードを書き続けるためにやってきたこと
kazuhiro4949
27
19k
10分で振り返るここ数年のWWDCの技術トレンド
kazuhiro4949
0
360
コードを書きながら同時に設計していくためのiOSアプリ開発方針
kazuhiro4949
6
2.7k
身近な技術的課題から始めるOSSプロジェクト
kazuhiro4949
0
370
Other Decks in Technology
See All in Technology
事業成長とデータ活用を止めないためのマネジメントへ挑戦
hiracky16
0
400
ブラウザとサーバーから考えるAI時代のフロントエンド監視
shogo4131
3
1k
大型犬好きによるPugの紹介
yamanoku
1
160
Running Kotlin + Quarkus with Lambda
nealle
1
4k
Browser Spec: Testing Hotwire with Ruby
takahashim
1
130
コンテナ運用におけるネットワーク・コンテナコストの削減方法/How to Reduce Network and Container Costs in Container Operations
masakiokuda
2
310
Benchmarking Disaggregated Serving on vLLM + Dynamo with a Real Coding-Agent Workload
nttcom
1
200
Classmethod Company Deck
satoshi7
1
740
会社説明資料
persolserverworks
0
9.8k
JAWS-UGグッズ職人仕事の流儀
kentapapa
0
120
Conditional PED-ANOVA: Hyperparameter Importance in Hierarchical & Dynamic Search Spaces
pfn
PRO
0
140
データエンジニアの次の戦場は "プロセスエンジニアリング"
sansantech
PRO
1
110
Featured
See All Featured
Tell your own story through comics
letsgokoyo
1
1.1k
The Invisible Side of Design
smashingmag
301
52k
Claude Code のすすめ
schroneko
67
230k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
540
My Coaching Mixtape
mlcsv
0
360
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
360
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
570
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
Transcript
J04ΞϓϦͷϨΠΞτΛճసͰ มߋ͢Δͱ͖ҙ͍ͯ͠Δ͜ͱ ,B[VIJSP)BZBTIJ /BHPZBJ04NFFUVQWPM
ࣗݾհ wྛ߂ w5XJUUFSɿLB[VIJSP wHJUIVCɿLB[VIJSP wRJJUBɿLB[VIJSP w:BIPP+BQBO$PSQ wJ04ΞϓϦΤϯδχΞ wJ04ΞϓϦࠇଳ
ΞυΧϨͰॻ͍ͨΛ͠·͢ IUUQTRJJUBDPNLB[VIJSPJUFNTEGGGCBFE
ΞδΣϯμ ճసڐՄͷઃఆ ϨΠΞτมߋΛߦ͏λΠϛϯά ճసͷڧ੍ ಈ࡞֬ೝ
ճసڐՄͷઃఆ
ճసڐՄͷઃఆ J1IPOFɾJ1BEͰڞ௨ͷ߹ϓϩδΣΫτϑΝΠϧ J1IPOFɾJ1BEͰม͑Δ߹*OGPQMJTU ը໘ຖʹࡉ͔͘ม͍͑ͨ߹"QQ%FMFHBUF͔7$ J1IPOF9Ͱ6QTJEF%PXOͰ͖ͳ͍
J1IPOFɾJ1BEͰڞ௨ͷ߹ ϓϩδΣΫτϑΝΠϧ
J1IPOFɾJ1BEͰڞ௨ͷ߹ ϓϩδΣΫτϑΝΠϧ
J1IPOFɾJ1BEͰڞ௨ͷ߹ ϓϩδΣΫτϑΝΠϧ
J1IPOFɾJ1BEͰม͑Δ߹ *OGPQMJTU J1BE J1IPOF
ը໘͝ͱʹࡉ͔͘ม͍͑ͨ ߹"QQ%FMFHBUF͔7$ "QQ%FMFHBUFͰͷ࣮ func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?)
-> UIInterfaceOrientationMask { return .all }
ը໘͝ͱʹࡉ͔͘ม͍͑ͨ ߹"QQ%FMFHBUF͔7$ 7$Ͱͷ࣮ override var supportedInterfaceOrientations: UIInterfaceOrientationMask { return .all
}
J1IPOF9ܥͩͱγεςϜͷઃఆ ͱͯ͠6QTJEF%PXO͕͖͔ͳ͍ w J1IPOF9ܥͰཪฦͨ͠߹ͷճస σόΠεϨϕϧͰޮ͔ͳ͍Α͏ʹͳͬ ͍ͯΔ
ϨΠΞτมߋΛ ߦ͏λΠϛϯά
ϨΠΞτมߋΛ ߦ͏λΠϛϯά override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator)
{ super.viewWillTransition(to: size, with: coordinator) coordinator.animate(alongsideTransition: { _ in if size.width > size.height { // ϨΠΞτมߋॲཧΛॻ͘ } else { // ... } }, completion: nil) } 6*7JFX$POUSPMMFSͷ"1*
ϨΠΞτมߋΛ ߦ͏λΠϛϯά w ઌఔͷճసΠϕϯτճస͢Δͱଈ࠲ʹݺΕΔ w 7$͕લ໘ʹ͍ͳ͍߹ɺճసͯ͠ଈ࠲ʹMBZPVU4VCWJFXT ͳͲݺΕ ͳ͍ w ճసޙͷϨΠΞτΛఆͨ͠ܭࢉΛ͜͜ॻ͍ͯ͠·͏ͱ่ΕΔ
w ϨΠΞτॲཧϨΠΞτΠϕϯτͰ࣮ͨ͠΄͏͕͍͍
ճసͷڧ੍
ճసͷڧ੍ w σόΠεͷճసΛڲਖ਼͢Δ"1*ͳ͍ w 7$͝ͱͷճసΛٖͬͯࣅతʹߦ͏
ճసͷڧ੍ override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation { return .landscapeRight } 6*7JFX$POUSPMMFSͷ"1*
͜ΕͰϞʔμϧ͕දࣔ͞ΕΔํΛܾΊΒΕΔɻ ͜ͷઃఆͩͱɺࠨ͔Βӈʹ͔ͬͯϞʔμϧ͕಄Λग़ͯ͘͠Δ
ճసͷڧ੍ 6*7JFX$POUSPMMFSͷ"1* ͜ΕͰσόΠεΛճͯ͠7$-BOETDBQF3JHIUͷ··ʹͳΔ override var supportedInterfaceOrientations: UIInterfaceOrientationMask { return .landscapeRight
} override var shouldAutorotate: Bool { return false }
ճసͷڧ੍ w ը໘͕ճస͢ΔΑ͏ͳΧελϜτϥϯδγϣϯΛ࣮ w σόΠε͕ճస͍ͯ͠ΔΑ͏ʹݟͤΒΕΔ w /PUJpDBUJPO$FOUFSͰPSJFOUBUJPO%JE$IBOHF/PUJpDBUJPOΛࢹ w σόΠεͷճసʹ߹ΘͤͯϞʔμϧΛදࣔͤ͞ΒΕΔ
ճసͷڧ੍ UIDevice.current.setValue( UIInterfaceOrientation.landscapeRight.rawValue, forKey: “orientation” ) ΩʔίʔσΟϯάͰϓϥΠϕʔτ"1*Λୟ͚ σόΠεճస͕Ͱ͖Δ
ಈ࡞֬ೝ
ಈ࡞֬ೝ w ճస7$͕Ͳͷ֊ʹ͍࣮ͯߦ͞ΕΔ w ϨΠΞτ7$ͷ֊্ͷҐஔදࣔͷ͞ΕํͰ࣮ߦ͞Εͳ͍ࣄ͕͋Δ
ಈ࡞֬ೝ w ैͬͯɺલ໘ʹݟ͍͑ͯΔͱ͖ͷϨΠΞτ͚ͩ֬ೝ͢Ε͍͍Θ͚Ͱͳ͍ w φϏήʔγϣϯͷதʹӅΕ͍ͯΔͱ͖ͳͲͰճసͷϝιου͕ݺΕͨ߹ͷ ςετ͓͍ͯͨ͠΄͏͕͍͍
Ҏ্ɺͭͷ؍Ͱ·ͱΊͯΈ·ͨ͠ ճసڐՄͷઃఆ ϨΠΞτมߋΛߦ͏λΠϛϯά ճసͷڧ੍ ಈ࡞֬ೝ