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.4k
商業雑誌に技術記事を寄稿した振り返り
tamappe
3
1.5k
リモートワークでBitriseを導入したときにハマりにハマった話
tamappe
0
250
SwiftUIとFlutterを比較する
tamappe
1
1.2k
レアジョブアプリでのアクセス負荷で生じたAPI遅延問題を アプリエンジニア視点で対策を考えてみる
tamappe
0
510
Fat Storyboardをリファクタリングしてみた
tamappe
0
300
Swift4.2で追加されたDynamic Member Lookupを使ってみよう
tamappe
0
860
Other Decks in Technology
See All in Technology
ガバメントクラウドのセキュリティ対策事例について
fujisawaryohei
0
530
小学3年生夏休みの自由研究「夏休みに Copilot で遊んでみた」
taichinakamura
0
140
UI State設計とテスト方針
rmakiyama
2
320
KnowledgeBaseDocuments APIでベクトルインデックス管理を自動化する
iidaxs
1
250
サーバレスアプリ開発者向けアップデートをキャッチアップしてきた #AWSreInvent #regrowth_fuk
drumnistnakano
0
190
生成AIのガバナンスの全体像と現実解
fnifni
1
180
WACATE2024冬セッション資料(ユーザビリティ)
scarletplover
0
190
5分でわかるDuckDB
chanyou0311
10
3.2k
OpenAIの蒸留機能(Model Distillation)を使用して運用中のLLMのコストを削減する取り組み
pharma_x_tech
4
540
[Ruby] Develop a Morse Code Learning Gem & Beep from Strings
oguressive
1
150
Snowflake女子会#3 Snowpipeの良さを5分で語るよ
lana2548
0
220
Snykで始めるセキュリティ担当者とSREと開発者が楽になる脆弱性対応 / Getting started with Snyk Vulnerability Response
yamaguchitk333
2
180
Featured
See All Featured
How to Ace a Technical Interview
jacobian
276
23k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
32
2.7k
Adopting Sorbet at Scale
ufuk
73
9.1k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
5
440
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Building Your Own Lightsaber
phodgson
103
6.1k
Why Our Code Smells
bkeepers
PRO
335
57k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
RailsConf 2023
tenderlove
29
940
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
Code Reviewing Like a Champion
maltzj
520
39k
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!