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
いざ、BSC討伐の旅
nikinusu
2
780
インフラとバックエンドとフロントエンドをくまなく調べて遅いアプリを早くした件
tubone24
1
430
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
3.9k
Incident Response Practices: Waroom's Features and Future Challenges
rrreeeyyy
0
160
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
950
生成AIが変えるデータ分析の全体像
ishikawa_satoru
0
170
FlutterアプリにおけるSLI/SLOを用いたユーザー体験の可視化と計測基盤構築
ostk0069
0
100
Flutterによる 効率的なAndroid・iOS・Webアプリケーション開発の事例
recruitengineers
PRO
0
120
Exadata Database Service on Dedicated Infrastructure(ExaDB-D) UI スクリーン・キャプチャ集
oracle4engineer
PRO
2
3.2k
マルチモーダル / AI Agent / LLMOps 3つの技術トレンドで理解するLLMの今後の展望
hirosatogamo
37
12k
Lambdaと地方とコミュニティ
miu_crescent
2
370
AWS Media Services 最新サービスアップデート 2024
eijikominami
0
200
Featured
See All Featured
Speed Design
sergeychernyshev
25
620
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Into the Great Unknown - MozCon
thekraken
32
1.5k
The Pragmatic Product Professional
lauravandoore
31
6.3k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Code Reviewing Like a Champion
maltzj
520
39k
Bash Introduction
62gerente
608
210k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
10 Git Anti Patterns You Should be Aware of
lemiorhan
655
59k
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!