NYTPhotoViewer icon indicating copy to clipboard operation
NYTPhotoViewer copied to clipboard

Add presenter independent interface orientation support

Open heikkihautala opened this issue 9 years ago • 4 comments

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.

heikkihautala avatar Apr 10 '15 10:04 heikkihautala

Do we have any update on this?

goyalpulkit avatar Jan 26 '16 15:01 goyalpulkit

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.

cdzombak avatar Jan 26 '16 15:01 cdzombak

+1 on this!

cassianodialpad avatar Apr 29 '21 13:04 cassianodialpad

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
    }
}

cassianodialpad avatar Apr 29 '21 15:04 cassianodialpad