Zooming child UIViewController to full screen
Asked Answered
T

0

8

I have a parent view controller with embedded child view controller. When user taps the child, I would like to present its view in full screen mode with 'extending frame' animation. A similar UI paradigm is used for instance to zoom pictures in the Facebook and 9GAG app.

Am I supposed to create a new controller for the full screen mode presentation and animate it as if it was merely on top of the child view controller? Or should I animate the child's view to extend to the superview's bounds?

I've heard about custom subclasses of UIStoryboardSegue and UIViewControllerTransitioning. Are these approaches applicable in my case?

What is the best way to accomplish this?

Thanks in advance. Pete.

P. S. After resolving this issue, I would like to extend my transition with interactive pinch-to-zoom gesture. If user touches the child view with two fingers, the frame animation reacts to the taps. When user puts his finger away, the animation should either revert, returning child's view to its original frame, or continue as if the user tapped the view.

Textual answered 1/9, 2014 at 21:28 Comment(4)
Did you resolve this? I would also like to transition an already present view controller to and from fullscreen, much like MPMoviePlayer for example.Tripp
Looking to achieve similar behaviour, did you solve the issue Petr Mánek?Cursive
Well, yes and no. I didn't solve the issue as I stated it above, I merely changed my app's UI layout to avoid this altogether. I'm still interested in finding solution to this as it's quite a neat UI transition and I haven't found a single article about it on the net or a CocoaPod with off-the-shelf implementation. Therefore, if by any chance you stumble upon anything or decide to implement it yourself, I would really appreciate a mention on this thread.Eared
I can't believe that only so few people ever tried this. If you really use UIKit like a good citizen you will have a bunch of view controllers as child view controllers in you apps, and it seems natural that some of those want to be taken to fullscreen. I managed to make such a transition work, but the code involves snapshotting the contained view and seems to specialised for my use case to share it with everyone.Marciano

© 2022 - 2024 — McMap. All rights reserved.