Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animation for presentation #129

Closed
erickva opened this issue Oct 5, 2016 · 4 comments
Closed

Animation for presentation #129

erickva opened this issue Oct 5, 2016 · 4 comments

Comments

@erickva
Copy link

erickva commented Oct 5, 2016

Whenever I present the viewController with:
presentViewController(cropViewController, animated: true, completion: nil)
I get a fade in animation, same story when I dismiss it, it shows me a fade out animation.

I wanted to revert it to the default iOS animations, slide from bottom when presenting and sliding to bottom when dismissing.

I tried return nil; for both animationControllerForPresentedController and animationControllerForDismissedController, but it only worked for the dismiss, when I present the viewcontroller I still get the fade in result.

Any idea how to revert to the default iOS presentation animation?

@TimOliver
Copy link
Owner

Hi @erickva! You were on the right track with making the animation controller return nil, but one other thing you had to do was specify the modalTransitionStyle of the controller itself:

TOCropViewController *cropController = [[TOCropViewController alloc] init];
cropController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;

I just pushed a new version that will disable the animation controller if the style is set to vertical, so if you update to that one, all you should need to do is add that extra line of code. :)

I hope that helped!

@erickva
Copy link
Author

erickva commented Oct 5, 2016

You are a Legend! Thank you.

@TimOliver
Copy link
Owner

No worries! Glad I could help! :) Enjoy!

@TylerWhiteDesign
Copy link

For swift, the only way I could change the modal presentation style was by accessing the child view controller: cropViewController.childViewControllers.first?.modalTransitionStyle = .coverVertical. Is there a better way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants