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
そのAlertController 回転ロックできないってよ
Search
tamappe
February 12, 2020
Technology
1
640
そのAlertController 回転ロックできないってよ
tamappe
February 12, 2020
Tweet
Share
More Decks by tamappe
See All by tamappe
async/awaitの性能をDartとSwiftとの比較で読み解く
tamappe
2
1.3k
商業雑誌に技術記事を寄稿した振り返り
tamappe
3
1.4k
リモートワークでBitriseを導入したときにハマりにハマった話
tamappe
0
250
SwiftUIとFlutterを比較する
tamappe
1
1.2k
レアジョブアプリでのアクセス負荷で生じたAPI遅延問題を アプリエンジニア視点で対策を考えてみる
tamappe
0
500
Fat Storyboardをリファクタリングしてみた
tamappe
0
300
Swift4.2で追加されたDynamic Member Lookupを使ってみよう
tamappe
0
850
Other Decks in Technology
See All in Technology
適材適所の技術選定 〜GraphQL・REST API・tRPC〜 / Optimal Technology Selection
kakehashi
1
160
AGIについてChatGPTに聞いてみた
blueb
0
130
障害対応指揮の意思決定と情報共有における価値観 / Waroom Meetup #2
arthur1
5
470
Amazon Personalizeのレコメンドシステム構築、実際何するの?〜大体10分で具体的なイメージをつかむ〜
kniino
1
100
20241120_JAWS_東京_ランチタイムLT#17_AWS認定全冠の先へ
tsumita
2
240
Terraform CI/CD パイプラインにおける AWS CodeCommit の代替手段
hiyanger
1
240
dev 補講: プロダクトセキュリティ / Product security overview
wa6sn
1
2.3k
SSMRunbook作成の勘所_20241120
koichiotomo
2
120
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.6k
Why does continuous profiling matter to developers? #appdevelopercon
salaboy
0
180
AWS Media Services 最新サービスアップデート 2024
eijikominami
0
190
誰も全体を知らない ~ ロールの垣根を超えて引き上げる開発生産性 / Boosting Development Productivity Across Roles
kakehashi
1
220
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
43
13k
Become a Pro
speakerdeck
PRO
25
5k
What's in a price? How to price your products and services
michaelherold
243
12k
A Philosophy of Restraint
colly
203
16k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Building Your Own Lightsaber
phodgson
103
6.1k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
Navigating Team Friction
lara
183
14k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
The Invisible Side of Design
smashingmag
298
50k
Adopting Sorbet at Scale
ufuk
73
9.1k
Transcript
ͦͷAlertController ճసϩοΫͰ͖ͳ͍ͬͯΑ @tamapppe potatotips #68 (iOS/Android։ൃTipsڞ༗ձ) 2020/2/12
I N T R O D U C T I
O N Tamappe (ͨ·ͬ) ϞόΠϧΞϓϦΤϯδχΞ 2014-20193݄·ͰϑϦʔϥϯεͱͯ͠׆ಈ 20194݄ΑΓϨΞδϣϒʹϞόΠϧΞϓϦΤϯδχΞͱͯ͠ೖࣾ झຯ: ήʔϜ(Splatoon2)ɺےτϨɺྉཧ Twitter: https://twitter.com/tamapppe 01
None
02
ຊͷςʔϚ iOSͷը໘ճస੍ޚ
͓͢͠Δ͜ͱ 03 - ճసͷ࣌ͷճస੍ޚ - ViewControllerͷ֊ - ճసϩοΫ (͜͜ͰճసͰ͖ͳ͍Α͏ʹ͢Δ͜ ͱ)
࠷ॳʹΫΠζ 04 ͜ͷUIViewControllerͷճసϩοΫͲ͜Ͱ੍ޚ͢Ε͍͍ʁ UITabBarController ʹ͍ͬͯΔ UINavigationController ʹ͍ͬͯΔ UIViewController ʹ͍ͬͯΔ presentViewController
ʹ͍ͬͯΔ UIAlertController (Ξϥʔτ) ͜ͷΞϥʔτ͕දࣔ͞Ε͍ͯΔ࣌ͷΈը໘͕ճస͞Εͳ͍Α͏ʹ͍ͨ͠ Ͳ͜Ͱ੍ޚ͢Ε͍͍ʁ ͜ΕΛղ͘ͷ͕ࠓճͷLTͷςʔϚͰ͢ɻ
← ͜ͷΞϥʔτ
Ͳͩ͜ͱࢥ͍·͔͢ʁ 05 1. UITabBarController 2. UINavigationController 3. UIViewController 4. presentViewController
5. UIAlertController
͕͠ผʹͳΓ·͕͢… ͷճసΛڐՄ͢Δํ๏Λ෮श͠·͢ 06 - Device Orientation - info.plist - ͦΕͧΕͷUIViewController
Ϋϥε
Device Orientation
Info.plist
info.plist 07 iPhoneͱiPadͱͰผʑʹཧ͍ͨ͠߹ʹΑ͍͘·͢ɻ - iPadճసͤ͞ͳ͍͚ͲɺiPhone͚ͩճస͍ͤͨ͞ - iPhoneͰճసͤͣ͞ʹiPad͚ͩճస͍ͤͨ͞ - iPhoneॎͷΈɺiPadԣը໘͚ͩ ͜Μͳ߹ʹΘΕ·͢ɻ
ͨͩ͠ɺ͜ΕશͯͷUIViewController ʹҰׅద༻ͤ͞Δͱ͖ͷΈ
ͦΕͧΕͷUIViewController Ͱ੍ޚ 08 Aը໘Ͱॎը໘ʹݻఆͯ͠ɺBը໘Ͱԣը໘͚ͩʹ͍ͨ͠ͳͲ UIViewController ୯ҐͰը໘ͷճసΛ੍ޚ͢Δ࣌ʹ͍·͢ɻ extension BaseNavigationController { //
ը໘Λճసͤ͞Δ͔Ͳ͏͔ override var shouldAutorotate: Bool { return true } // ճసํͷࢦఆ override var supportedInterfaceOrientations: UIInterfaceOrientationMask { return .all } }
ͬͱຊͰ͢ 09 ͜ͷUIViewControllerͷճసϩοΫͲ͜Ͱ੍ޚ͢Ε͍͍ʁ UITabBarController ʹ͍ͬͯΔ UINavigationController ʹ͍ͬͯΔ UIViewController ʹ͍ͬͯΔ presentViewController
ʹ͍ͬͯΔ UIAlertController (Ξϥʔτ)
͑ 10 ͜ͷUIViewControllerͷճసϩοΫͲ͜Ͱ੍ޚ͢Ε͍͍ʁ UITabBarController ʹ͍ͬͯΔ UINavigationController ʹ͍ͬͯΔ UIViewController ʹ͍ͬͯΔ presentViewController
ʹ͍ͬͯΔ UIAlertController (Ξϥʔτ) ( <- ίί) Answer) UIAlertController
͑ (ίʔυ) 11 UIAlertController+Orientation.swift import UIKit extension UIAlertController { open
override var shouldAutorotate: Bool { return false } open override var supportedInterfaceOrientations: UIInterfaceOrientationMask { return .portrait } }
ͦΕͧΕͷViewController Ͱ੍ޚ͢Δ߹ 12 UIAlertController → UIAlertController presentViewController →UINavigaitonController UITabBarController ʹ͍ͬͯΔUINavigationController
ʹ͍ͬͯΔUIViewController → UITabBarController
Ҏ্ 13 ͷճసΛڐ͢ͱճసϩοΫͳͲͷ੍ޚ͕େมʹͳΓ ·͢ɻ චऀճసܥͷϝιουΛॻ͘߹ExtensionͰॻ͘ ͜ͱ͕ଟ͍Ͱ͢ɻ
Thank you!