Upgrade to Pro — share decks privately, control downloads, hide ads and more …

そのAlertController 回転ロックできないってよ

Avatar for tamappe tamappe
February 12, 2020

そのAlertController 回転ロックできないってよ

Avatar for tamappe

tamappe

February 12, 2020
Tweet

More Decks by tamappe

Other Decks in Technology

Transcript

  1. I N T R O D U C T I

    O N Tamappe (ͨ·ͬ΃) ϞόΠϧΞϓϦΤϯδχΞ 2014೥-2019೥3݄·ͰϑϦʔϥϯεͱͯ͠׆ಈ 2019೥4݄ΑΓϨΞδϣϒʹϞόΠϧΞϓϦΤϯδχΞͱͯ͠ೖࣾ झຯ: ήʔϜ(Splatoon2)ɺےτϨɺྉཧ Twitter: https://twitter.com/tamapppe 01
  2. 02

  3. ࠷ॳʹΫΠζ 04 ͜ͷUIViewControllerͷճసϩοΫ͸Ͳ͜Ͱ੍ޚ͢Ε͹͍͍ʁ UITabBarController ʹ৐͍ͬͯΔ UINavigationController ʹ৐͍ͬͯΔ UIViewController ʹ৐͍ͬͯΔ presentViewController

    ʹ৐͍ͬͯΔ UIAlertController (Ξϥʔτ) ͜ͷΞϥʔτ͕දࣔ͞Ε͍ͯΔ࣌ͷΈը໘͕ճస͞Εͳ͍Α͏ʹ͍ͨ͠ Ͳ͜Ͱ੍ޚ͢Ε͹͍͍ʁ ͜ΕΛղ͘ͷ͕ࠓճͷLTͷςʔϚͰ͢ɻ
  4. ͦΕͧΕͷUIViewController Ͱ੍ޚ 08 Aը໘Ͱ͸ॎը໘ʹݻఆͯ͠ɺBը໘Ͱ͸ԣը໘͚ͩʹ͍ͨ͠ͳͲ UIViewController ୯ҐͰը໘ͷճసΛ੍ޚ͢Δ࣌ʹ࢖͍·͢ɻ extension BaseNavigationController { //

    ը໘Λճసͤ͞Δ͔Ͳ͏͔ override var shouldAutorotate: Bool { return true } // ճసํ޲ͷࢦఆ override var supportedInterfaceOrientations: UIInterfaceOrientationMask { return .all } }
  5. ౴͑ (ίʔυ) 11 UIAlertController+Orientation.swift import UIKit extension UIAlertController { open

    override var shouldAutorotate: Bool { return false } open override var supportedInterfaceOrientations: UIInterfaceOrientationMask { return .portrait } }