presentViewController from UINavigationController&

2019-07-23 23:06发布

问题:

I am having some weird animation issues. I called presentViewController with animation set to YES but the animation is not present when the view controller is being presented. And the weirdest thing is all animations throughout the app are gone!

So basically my setup is like this

UINavigationController has child view controller - childVC

I have childViewController to call presentViewController - presentVC and have a delegate callback method for childViewController to dismiss presentVC.

One interesting thing I found is this

[childVC presentViewController: presentVC];
NSLog(@"%@", [presentVC presentingViewController]); <- this prints UINavigationController!

Shouldn't it prints childVC? I am really confused with why it prints the parentController of the childVC instead.

I have been stuck on this weird animation issue for a very long time. I wonder if the presentingViewController being the UINavigationController have something to do with it?

Thoughts?

/* edited */ another thing I forgot to mention is that, childVC is part of the subclass of ECSlidingViewController, (meaning it childVC is one of the topViewController, underleftViewController or underRightViewController) if that makes any difference.