-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loading indicator disappears randomly. #447
Comments
Will take a look at it soon. |
@hifall Hi, After some investigation, I believe there is no issue in Kingfisher's loading indicator behaviors. The issue you encountered might be related to the changes on collection view/table view in iOS 10. If you are calling Kingfisher's You could try to put your set image code to |
You could find more about this change in iOS in session 219 |
Some sample code added in #448 to show how to get performance benefit from iOS 10's prefetching cell and new cell life cycle. |
Okay -- thanks for the heads-up. But the issue happened in iOS 9.3.5, instead of 10. Not sure enough at the moment what's going on, yet. I will take a deeper look into this later. |
So, I did try a few more times on iOS 9.3.5., and I saw the issue again. Although I did not dig through the source code to find the problem. |
I have the same problem, before Xcode 8 and the transition to swift 2.3, the activity indicator worked properly on all my collectionViews. Now it doesn't work. |
@codeido I can not reproduce this issue on my environment (I tried both iOS 9 and 10). Can you build a sample project for this? So I can dig into it deeper. |
@onevcat you used swift 2.3? |
Yes, I tried swift2.3 branch and cannot reproduce it. But I did find a bug which might stop you from setting the |
I fixed it on swift 2.3 and iOS 10 calling kf_showIndicatorWhenLoading=true before the method kf_setImageWithURL 👍 :| |
@codeido So may I know what's your original code? Maybe it could be improved. |
Yeah @onevcat ! My original code was:
now is:
|
I don't see much difference between your code and what I posted at top, except that you pass in non-nil optionsInfo. I tried yours, but the problem stays. |
Regarding your comment: "But I did find a bug which might stop you from setting the kf_showIndicatorWhenLoading to false, but it should not relate to this issue, if you are only setting it to true.", this is what it's like in our scenario: we have 2 types of images managed using Kingfisher, one that displays a loading indicator when the image is being loaded, and the other one that displays NO loading indicator. So indeed, kf_showIndicatorWhenLoading can be set to false in our case -- could that cause the images that are supposed to display a loading indicator to actually fail to do so? |
This issue happens around 50% chance on my device. So once you have a fix for the kf_showIndicatorWhenLoading issue you mentioned, maybe I can give it a test here. |
I am not seeing any new commit from last few hours in swift2.3 branch. Am I missing something here? |
It should be there. I made the change earlier, just didn't push it until now. |
Thanks @onevcat. I have tested your fix. But the problem still shows. |
@hifall Ummm, checked the code again and not sure about why. Are you trying to set the indicator and/or image in another thread instead of main thread? |
Or if there is a demo could reproduce it, I'd like to dig it deeper. Currently I cannot reproduce it so it's quite hard to debug. |
@hifall Hi, any progress for this? |
I have not been able to find time to isolate this issue in a reasonably small project. I will get back to you when I can. |
I found the loading indicator can disappear sometimes in such a scenario, but I have not found a consistent repro yet.
This happens in a table view with some chat messages.
1 fill the table view with about a dozen messages;
2 inert an image message whose image is managed by Kingfisher by calling:
imageView?.kf_showIndicatorWhenLoading = true
imageView?.kf_indicatorType = .Activity
imageView?.kf_setImageWithURL(...) with a placeholder image;
now the loading indicator shows up;
3 while the image is being loaded, scroll it out of the view port of the table, so that the image is not visible;
4 scroll the image back into the view port to make it visible; now the loading indicator could be missing even when the image is still being loaded.
The text was updated successfully, but these errors were encountered: