Allow media viewer to be rotated to any orientation

This commit is contained in:
Jed Fox 2022-11-22 16:19:18 -05:00
parent e0d53efecc
commit 0910baab6c
No known key found for this signature in database
GPG Key ID: 0B61D18EA54B47E1
4 changed files with 11 additions and 7 deletions

View File

@ -165,6 +165,10 @@ extension MediaPreviewViewController {
!viewModel.showingChrome !viewModel.showingChrome
} }
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
.all
}
} }
extension MediaPreviewViewController { extension MediaPreviewViewController {

View File

@ -369,6 +369,9 @@ extension MainTabBarController {
updateAvatarButtonAppearance() updateAvatarButtonAppearance()
} }
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return UIDevice.current.userInterfaceIdiom == .phone ? .portrait : .all
}
} }
extension MainTabBarController { extension MainTabBarController {

View File

@ -112,6 +112,10 @@ extension RootSplitViewController {
self.updateBehavior(size: size) self.updateBehavior(size: size)
} }
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return UIDevice.current.userInterfaceIdiom == .phone ? .portrait : .all
}
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection) super.traitCollectionDidChange(previousTraitCollection)

View File

@ -64,13 +64,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
} }
extension AppDelegate { extension AppDelegate {
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
return UIDevice.current.userInterfaceIdiom == .phone ? .portrait : .all
}
}
extension AppDelegate {
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
appContext.notificationService.deviceToken.value = deviceToken appContext.notificationService.deviceToken.value = deviceToken
} }