PMAlertController icon indicating copy to clipboard operation
PMAlertController copied to clipboard

Change disappear animation to fade out

Open vsg24 opened this issue 7 years ago • 4 comments

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)

vsg24 avatar Jun 02 '18 19:06 vsg24

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

pmusolino avatar Jun 10 '18 21:06 pmusolino

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?

vsg24 avatar Jun 11 '18 00:06 vsg24

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

  • Paolo

pmusolino avatar Jul 16 '18 09:07 pmusolino

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

Daksh14 avatar Aug 01 '19 17:08 Daksh14