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
790
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
そのAlertController 回転ロックできないってよ
tamappe
February 12, 2020
More Decks by tamappe
See All by tamappe
async/awaitの性能をDartとSwiftとの比較で読み解く
tamappe
2
1.9k
商業雑誌に技術記事を寄稿した振り返り
tamappe
3
1.8k
リモートワークでBitriseを導入したときにハマりにハマった話
tamappe
0
350
SwiftUIとFlutterを比較する
tamappe
1
1.5k
レアジョブアプリでのアクセス負荷で生じたAPI遅延問題を アプリエンジニア視点で対策を考えてみる
tamappe
0
610
Fat Storyboardをリファクタリングしてみた
tamappe
0
370
Swift4.2で追加されたDynamic Member Lookupを使ってみよう
tamappe
0
950
Other Decks in Technology
See All in Technology
tamachi.go 誕生の裏側
rymiyamoto
1
200
フィジカルAIの知識ゼロの僕でも AIを使えばここまでできた
tatsuya1970
0
150
トークンマネジメントでAIにとって働きやすい環境を実現する
hikaruegashira
0
140
強化学習「理論」入門
enakai00
3
3.6k
自宅NWにISR4331を導入してみた話
okaits
0
120
AIにブラウザを触らせて、E2EテストをPlaywrightで書く
koji_kawamura
0
380
英語が話せなくてもKubeConスタッフに参加した話
yusuke427
2
1.1k
8bit CPU 2026
koba789
7
2.7k
アクセスキーが漏れた日にやるべきこと- 無効化の先にある本当の対応
kazzpapa3
0
260
形式手法特論:Hyperproperty とモデル検査 #kernelvm / Kernel VM Study Tokyo 19th
ytaka23
0
680
AIのためのEthernet技術動向 (SerDes)
markunet
1
300
長期運営で肥大化したExcelマスターデータの解消に向けた移行事例
gree_tech
PRO
0
320
Featured
See All Featured
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
810
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
57k
Navigating Team Friction
lara
192
16k
Scaling GitHub
holman
464
140k
The Spectacular Lies of Maps
axbom
PRO
1
940
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
300
Ruling the World: When Life Gets Gamed
codingconduct
0
310
Done Done
chrislema
186
16k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
660
The Cost Of JavaScript in 2023
addyosmani
55
10k
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!