v-braun / VBRRollingPit

Simple, beautiful and interactive UITabBar
MIT License
329 stars 51 forks source link

How can change the animation time between moves? #15

Open berildoguc opened 4 years ago

berildoguc commented 4 years ago

Hi, your library is very good. I am using it. But, how can change the animation time between moves?

v-braun commented 4 years ago

Hi! This parameter is currentley hard-coded. I have right now not that time to add new features here but will keep this open til it is available.

You can do it yourself, here are the two values you have to adopt:

  1. move animation duration
  2. opacity animation duration
berildoguc commented 4 years ago

I changed this values like: DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + .milliseconds(100) , execute: { UIView.animate(withDuration: 0.1) { itemView.alpha = 1 } } and animation.duration = 0

but anything changed. What should I do?

v-braun commented 4 years ago

Are you sure that your changes where really applied? Have you installed the lib via cocoapods or copied the code over? Maybe "0" is not a valid value for animations, can you set it to 100 or so to see a difference?

berildoguc commented 4 years ago

I have installed the lib via cocoapods. I will try to set it to 100. Hope it helps otherwise I ask you again. Thanks...

berildoguc commented 4 years ago

Nothing changed. I am going to wait until you add new features. Even so it is a very good library, thanks for your time.

v-braun commented 4 years ago

Not sure that code modifications work with cocoapods. My recomendation is to copy the file RollingPitTabBar into your project and adapt there the values. Remove the cocoapod dependency and this should work for you.

Later when I do the update you can remove the file again and use the pod

Scankiran commented 3 years ago

private func createPathMoveAnimation(toVal : CGPath) -> CABasicAnimation{ let animation = CABasicAnimation(keyPath: "path") animation.duration = 1

I setted duration to 0.3 and it works. You can find code on lines between 245 and 248.

berildoguc commented 3 years ago

I will check this thanks.