Any idea about how the feature I show in this video is done? It looks like the touch on the "expand" button force an orientation change for the device (infact when I swipe I'm pulling the control centre out). Anyway only the video player seems to rotate. the scrollview underneath keeps its portrait orientation.
Asked
Active
Viewed 1,231 times
5
-
have you figured it out? I'm trying to do something similar. – Pangu Mar 13 '16 at 22:02
-
@Pangu any luck? – Walker Apr 24 '17 at 14:37
-
have you figured this out? – Johnykutty Feb 04 '20 at 22:08
1 Answers
0
Looks like they're presenting the player controller with a custom segue animation, while having the player controller supporting only landscape.
Try presenting a view controller that has these implemented, like so:
override func supportedInterfaceOrientations() -> Int {
return Int(UIInterfaceOrientationMask.Landscape.rawValue)
}
override func preferredInterfaceOrientationForPresentation() -> UIInterfaceOrientation {
return UIInterfaceOrientation.LandscapeLeft
}
override func shouldAutorotate() -> Bool {
return false
}
Then the device should be in landscape. All you have left is to do the custom transition animation between the two and you're done.
From the docs:
preferredInterfaceOrientationForPresentation
If your view controller implements this method, your view controller’s view is shown in the preferred orientation

Andrew
- 3,166
- 21
- 32
-
1You think they are presenting a new player controller. let's say the video is playing in portrait already. Then I press the expand button: what i notice is that the video (that you suggesting might be presented from scratch) starts exactly from the same point with no delay at all. how do you think they handle this situation?? – luca Nov 23 '15 at 17:34
-
You can transplant the same player from the first view controller to the presented one, while doing the custom transition and it'll keep playing while the animation is happening. – Andrew Nov 23 '15 at 17:52
-
3