From 4b5ea10b404066e84594b9e3a96859b684add4cc Mon Sep 17 00:00:00 2001 From: Yishi Lin Date: Fri, 7 Jul 2017 17:36:04 +0800 Subject: [PATCH] Force the PasscodeLockVC to be portrait --- pass/AppDelegate.swift | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pass/AppDelegate.swift b/pass/AppDelegate.swift index f50ac64..c08f282 100644 --- a/pass/AppDelegate.swift +++ b/pass/AppDelegate.swift @@ -38,6 +38,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate { return true } + func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask { + if let _ = window?.rootViewController as? PasscodeLockViewController { + // Force the PasscodeLockVC to be portrait because the rotation seems bugy in some cases + return .portrait + } else { + return .all + } + } + func postSearchNotification() { NotificationCenter.default.post(name: .passwordSearch, object: nil) }