Comments (6)
First: There is no reason why you created duplicate issues as issues can be edited, just a tip for the future as this clutters my issues.
Second: Please follow the issue submission template before posting an issue.
Finally: This seems to be an issue with your logic, you cannot animate in cellForItemAt
as this is called before the view is even presented which is why you do not see the animation but you get a callback. You will need to find a better place to animate your cells. Try viewDidAppear
or viewWillAppear
.
Let me know if this solves your issue.
from uicircularprogressring.
First: It was obviously an error...as you can see I closed the previous one...
About the issue, to be honest, this is the first library that doesn't work on the cellForItemAt
or willDisplay
of a collection, doesn't make much sense have to handle the animations inside a cell from outside the collection.
If I put the code on the viewDidAppear
of the VC it works, but only for the first cell of course. As soon as I go to the next cell, the animation doesn't work.
I'm trying to solve this but still no luck...
from uicircularprogressring.
Sorry for coming off as a bit annoyed, it's just people really don't like to follow the proper way of submitting issues which makes it way harder to fix problems.
I haven't used too many collection views in the past and have not tested this lib with the use of cells. I just know that if it works like a tableView does then cellForItemAt
will get called before the view appears, this is because it needs to load that data to present the cell to the user. Test it by putting a break point there. The lib is working as you get a call back after animation completion, you just can't see the animation due to the fact the view wasn't on screen.
Have you tried using willDisplayCell
and calling setProgress there? Besides this to continue forward and see if this is a bug with the library, I would need some sample code or for you to email me or post the full project. Email me here if you prefer to keep it private.
from uicircularprogressring.
No worries.
Yes, I tried on willDisplayCell
and has the same issue.
One way I fixed the issue is calling a selector with a delay after the willDisplayCell
, which of course sucks but I tried to test stuff and this worked.
But after that I remember that CollectionView
is a ScrollView
, so I use the scrollViewDidEndScrollingAnimation
to set the progress and now is working. Of course you have to store the current cell in the screen for this (and also for reseting the progress when you reenter the screen after pushing another VC, which btw only works if I set the progress to 0 on the completion block of the previous setProgress
).
Either way, if you want a sample project I could build something based on my current project. I tried to debug your code in order to try to fix the issue on the library but I'm not too good with the animation framework...
from uicircularprogressring.
Yeah if you have the time I'd appreciate an example project or something with reproducible behavior as I am currently busy with work and school and this will speed things up, thanks!
from uicircularprogressring.
So I've taken a look at the project you sent me and yes I definitely see what you're saying now. I'm not sure this is a bug with this project in particular just yet. Since it seems odd that this animation works fine every where else, except for the first two items in a collection view...
Found this repo while doing more research and it seems like thats the same thing you're experiencing. I'll take another jab at it whenever I get another chance.
In the mean time I will post what you did to work around it, in the case anyone else is experiencing this.
For others
@scastro is experiencing an issue with the first few items not showing the animation. He has a CollectionView which automatically scrolls through some cells. The first two cells were not animating. He was doing the animation code inside of willDisplayCell
of the collectionView delegate.
To work around this he removed the animation code from there and did this
func scrollViewDidEndScrollingAnimation(_ scrollView: UIScrollView) {
cell.ring.setProgress(value: 100, animationDuration: 2.0) {
print("Progress finished")
}
}
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.