AjayBhanushali / ABGaugeViewKit

ABGaugeViewKit is a framework which will help you to add Gauge View in your iOS App.
MIT License
27 stars 25 forks source link

Animation help? #2

Open matt-green-ra opened 6 years ago

matt-green-ra commented 6 years ago

Hello Ajay! This is great. I'm excited to use it in my app =). I've implemented it and am able to change all values needed. I'd like to be able to adjust the animation values. Is this possible? The needle "bounces" more than I'd like it to. Would it be possible to have it approach the value and bounce less and more smoothly? Thanks!

matt-green-ra commented 6 years ago

I did this inside your drawNeedle() function:

animate(triangleLayer: triangleLayer, shadowLayer: shadowLayer, fromValue: needleValue-2, toValue: needleValue+2, duration: 0.2) {
            self.animate(triangleLayer: triangleLayer, shadowLayer: shadowLayer, fromValue: self.needleValue+2, toValue: self.needleValue-2, duration: 0.1, callBack: {
                self.animate(triangleLayer: triangleLayer, shadowLayer: shadowLayer, fromValue: self.needleValue-2, toValue: self.needleValue, duration: 0.2, callBack: {})
            })
        }

It's close enough to get the job done for now. If you update this with more animation options that would be AWESOME! Thanks for building and sharing. I found you on Medium =)

beherasusanta commented 5 years ago

Hello Ajay. Nice Framework i have implemented in my application. Actually in iPhone XR the app is crashing(Client's device) in ABGaugeView.getAllAngles(). Can you pls guide me what may the issue.