Comments (5)
You're going to have to be more specific, I don't understand what you're asking.
Provide code samples or be more clear in your question.
You can read the documentation here
There you should see that to change the animation duration, you have to call setProgress(value:animationDuration:completion:)
where animationDuration
is the amount of seconds you would like to animate for.
from uicircularprogressring.
function animate with duration = 1.0 is not working on seconds basis.
I have tried with duration = 1, 10, 20, 30 and so on. Nothing works.
I just want it to animate per second i.e on seconds basis. So, for that, what should be the duration to animate it per second ?
FUNCTION:
setProgress(value: 30, animationDuration: 1.0)
It is not animating on a second basis.
I compared it with stopwatch. It was not animating on per second basis.
from uicircularprogressring.
I'm not doing any custom animations with this view. I use the built in animation system from Apple.
Here is the code which calls the animation
if event == "value" && self.animated {
let animation = CABasicAnimation(keyPath: "value")
animation.fromValue = self.presentation()?.value(forKey: "value")
animation.timingFunction = CAMediaTimingFunction(name: animationStyle)
animation.duration = animationDuration
return animation
}
The animation duration is the value passed in when setProgress
is called. Animation style can be change by assigning animationStyle
for the ring view. The list of timing functions can be found here.
Now as for the animation duration not being exact, I'm not sure why you're having that issue, I just tested it out with a stop watch as well and they seem to stop around the same time sent to the function (in seconds).
Have you taken a look at the example project? If you don't mind posting your code, i can help further.
from uicircularprogressring.
kCAMediaTimingFunctionLinear should work on a linear basis i.e animation should work linearly without speeding fast or slow at any time. Right?
If i put total time = 30 seconds and compare it with stopwatch, it works fine but distribution of animation duration is not exact. It first slows, then speeds up and then becomes slow when reaching near the total. technically, it should be linearly distributed. No speed slow or quick.
Got my point?
I am using linear timing function, still, it is not working.
ring.animationstyle = kCAMediaTimingFunctionLinear
I am doing it in your example project only. I will implement it in my app after i will do it on example project first.
from uicircularprogressring.
Huh thanks for bringing this to my attention.
For some reason I wasn't updating the layers animationStyle.
Fixed in latest release, 1.1.3
run pod update
for latest changes
Will close issue unless you have something else.
from uicircularprogressring.
Related Issues (20)
- UICircularProgressRing crashes on init(frame:) while running on iOS9 HOT 7
- Restart animation from a new angle after returning from background HOT 13
- Timer and Progress in the same screen HOT 2
- Module compiled with Swift 5.1.3 cannot be imported by the Swift 5.2.4 compiler HOT 4
- Want to add dash style for inner ring HOT 4
- Count-down Timer HOT 2
- support of dark mode change inside app HOT 1
- How can I make the knob got to the end vs. centered around the end
- Size and offset.
- Adding the library via SPM fails HOT 4
- Update the podspec file to include swiftUI updates HOT 1
- xcodebuild: error: Could not resolve package dependencies: Authentication failed because no credentials were provided HOT 3
- Cannot add legacy version via CocoaPods HOT 1
- In UICircularTimerRing give the option to be countdown rather than countup HOT 1
- Help: Customising the ValueKnob? HOT 1
- How to animation from two angle?
- Increase font size of percentage and add any label there
- Cannot find type 'UICircularProgressRing' in scope (installed via SPM) HOT 5
- Swift Compiler Warning - Deprecated protocol inheritance HOT 1
- luispadron/SnapshotTesting is not found.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uicircularprogressring.