pmusolino / PMAlertController

PMAlertController is a great and customizable alert that can substitute UIAlertController
MIT License
2.53k stars 186 forks source link

Change disappear animation to fade out #64

Closed vsg24 closed 11 months ago

vsg24 commented 6 years ago

Hi,

I love this project however the disappearing animation does not suit my app. I need to change it to something like a fade out (or something else really). I could'n find any way to achieve this. Please help (Some example code would be appreciated)

pmusolino commented 6 years ago

Hi @VSG24,

currently is not possible to change the animation, but is a good improvement for a next version.

If you think you have a valid and dynamic solution, implement it and open a pull request, please. Otherwise, you can fork the project and implement your fade out animation.

Thanks -Paolo

vsg24 commented 6 years ago

Thanks for your response. I want to fork the project and change the animation myself but I'm not sure where the code for anination exists. Can you point me to the right direction?

pmusolino commented 6 years ago

Hi @VSG24 and sorry for the delay!

There is a method called animateDismissWithGravity where you can change the animation! Consider that currently PMAlertController use UIDynamicAnimator, but you can use whatever you want.

If you can make the animation system generic, you can open a pull request. Otherwise, you can point your project to your fork.

Thanks

Daksh14 commented 5 years ago

Hello, if someone wants to disable the gravity animation do

let alertVC = PMAlertController(title: "Options", description: nil, image: nil, style: .alert)
alertVC.gravityDismissAnimation = false // this here