Re: Custom UIViewController transitions with segues
Re: Custom UIViewController transitions with segues
- Subject: Re: Custom UIViewController transitions with segues
- From: Roland King <email@hidden>
- Date: Thu, 31 Dec 2015 10:14:55 +0800
> On 31 Dec 2015, at 09:12, Rick Mann <email@hidden> wrote:
>
> I have a UICollectionView in a UINavigationController, and I'd like to customize the transition from one to the next on push. So I set up the first VC as UIViewControllerTransitioningDelegate, and in prepareForSegue(_:sender:) set the destination VC's transitioningDelegate to self.
>
> But my delegate methods never get called. The docs say to set modalPresentationStyle to .Custom, but that has no effect (also, it's a bit weird since this is not technically a modal presentation, is it?).
>
> Search for solutions online turns up only custom segues, which is not really what I want.
>
> Is it even possible to do this with segues? What am I missing?
>
> TIA,
My thought here is that push != present, ie pushViewController(_:animated) doesn’t do the same thing as presentViewController(_:animated:completion) and that push calls the former and other modes call the latter. I dunno what I’d try, the whole UIViewController custom transitioning thing confuses the bananas out of me and I never found the WWDC videos on them to be as helpful as I wished. Perhaps change the push to a present to get it on the screen, then when you’re done with the transition, call pushViewController( vc, animated : false ) to fix up the nav stack. That will probably look really ugly as the nav bar will likely just snap to the new content.
There’s probably 18 other ways to do it. I’d bung some hooks into any methods I could find which run early in the viewcontroller presentation lifecycle and see if there’s a transition coordinator or animation coordinator or whatever objects transitions create which I could hook into and animate alongside.
In general .. having fiddled with custom transitions when the were new and shiny .. I don’t bother with them any more.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden