-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
isSkeletonActive
returns incorrect value
#421
Comments
@Juanpe any chance being able to look into this issue? |
Hi @p-nicolaou, The library reloads the data when the skeleton will hide, although you can omit this step. |
Thank you for your response @Juanpe, I've tried that already with no luck unfortunately. One thing I noticed is that, by calling |
Mm, ok, maybe it's related to the transition. If you dispatch after 0.25secs, it should work as well. I'm not sure why this issue but with this clue I'm on track of find a possible solution, meanwhile a workaround for you could be dispatching the reload data task after 0.3secs |
I will try to replicate it in a sample project as well. That way, I can share the full code as well. In the mean time, have a look at this too. Might be helpful somehow, I've change the
Then, I ran my app using versions SkeletonView 1.16.0 & 1.17.2 1.16.0
1.17.2
|
@Juanpe I can confirm that by passing transition = .none here, |
Yeah, made sense :) I've created a branch with a possible fix. I think it'll be enough. Please, could you point to this branch to check if the problem is solved? pod 'SkeletonView', :git => 'https://github.com/Juanpe/SkeletonView.git', :branch => 'bug/set_skeleton_off_before_transition'
|
I can confirm that the problem is solved under the branch Good catch. 🙂 |
Great! I'll create a new version that includes this fix. Thanks for your help 🤙🏼 |
Thank you for taking the time looking into this |
Version 1.21.2 has been released 🚀 |
Description
In our app, we display the SkeletonViews while waiting for remote data to be available. Once received, we hide skeleton and call
reloadData()
In addition, we're implementing UITableViewDelegate's method as below
in order to update the UI with some extra info.
Everything was working as expected while on SkeletonView 1.15.0.
Recently, we attempted to upgrade to a most recent 1.20.0 but doing so we realise that the logic described above is now broken.
view.isSkeletonActive
is shown astrue
even though we've called thehideSkeleton()
before that.We've spent few days in order to understand what's going on but eventually it comes down to this merge #402 (comment). If I revert the changes described into this commit then, everything works as before. I understand that this change has been introduced with 1.17.0. The 1.16.0 works ok too.
Do we have to use
isSkeletonActive
in a different way since 1.17.0 or is this an actual bug?What type of issue is this? (place an
x
in one of the[ ]
)Requirements (place an
x
in each of the[ ]
)Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
SkeletonView Environment:
SkeletonView version: 1.20.0
Xcode version: 12.5.1
Swift version: Swift 5.5
Steps to reproduce:
Please replace this with the steps to reproduce the behavior.
willDisplayCell
of UITableViewDelegate protocolview.isSkeletonActive
insideviewDidLayoutSubviews
callview.showAnimatedGradientSkeleton(animation: animation)
onceview.hideSkeleton()
andtableView.reloadData()
after a whileExpected result:
view.isSkeletonActive
should printfalse
Actual result:
view.isSkeletonActive
printstrue
Attachments:
These screenshots show the actual value of
isSkeletonActive
when is called inside willDisplayCell using versions 1.16.0 and 1.17.0 (as described on reproduce steps above).The text was updated successfully, but these errors were encountered: