Re: UINavigationController back gesture animation
Re: UINavigationController back gesture animation
- Subject: Re: UINavigationController back gesture animation
- From: David Duncan <email@hidden>
- Date: Wed, 15 Jun 2016 09:21:12 -0700
Most pushes end up deferred (they don’t happen until the run loop turns) so the transition coordinator would not have been created yet.
Try using the UINavigationController delegate methods, -navigationController:willShow/didShowViewController:animated:, instead.
> On Jun 15, 2016, at 7:57 AM, Torsten Curdt <email@hidden> wrote:
>
> Since I am getting nowhere with this I thought maybe at least I could know
> when the animation finishes.
> So I was trying it like this:
>
> extension UINavigationController {
> func pushViewController(viewController: UIViewController, animated:
> Bool, completion: (Void -> Void)) {
> pushViewController(viewController, animated: animated)
>
> if let coordinator = transitionCoordinator() where animated {
> coordinator.animateAlongsideTransition(nil) { _ in
> completion()
> }
> } else {
> completion()
> }
> }
> }
>
> ...but the coordinator is just nil.
>
> Any thoughts?
> _______________________________________________
>
> 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
--
David Duncan
_______________________________________________
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