NYTPhotoViewer
NYTPhotoViewer copied to clipboard
Add presenter independent interface orientation support
NYTPhotosViewController inherits the supported interface orientations from the presenter, because the modal presentation style is set to UIModalPresentationStyleCustom.
My presenter view controller only supports portrait mode, but I would like to support landscape on the NYTPhotosViewController.
I have set NYTPhotosViewController's presentation style to the default value (UIModalPresentationStyleFullscreen) after the initialization to support other orientations too, but this breaks at least the interactive fade animations when UIPhotosViewController is closed by swiping the view up or down.
Do we have any update on this?
Do we have any update on this?
No; we haven't prioritized working on this internally. As always, pull requests would be welcomed as a starting point for discussion.
+1 on this!
I was able to work around it by enabling all orientations on my app and using this on my AppDelegate:
func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
// We want photos to rotate.
if window?.rootViewController?.presentedViewController is NYTPhotosViewController {
return .all
} else {
return ANY_ORIENTATIONS_DESIRED_TO_BE_SUPPORTED_BY_MY_APP
}
}