Juanpe / SkeletonView

☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting
MIT License
12.5k stars 1.1k forks source link

UITableView subviewsToSkeleton is empty when tableview is not showing in screen. #529

Open SunZhiC opened 1 year ago

SunZhiC commented 1 year ago

Description

I have a page view, it has two child view, a tableView and a collectionView, both of then are isSkeletonable. when I call show skeletionView in tableview, then scroll to collectionView, then call hide skeletionView, collectionView works fine, skeletionView is disappeared, but when I scroll back to tableView, tableView cell's skeletionView is showing. In SubviewsSkeletonables.swift, I see tableView extension, why you check this window != nil when return subviewsToSkeleton? When tableView is not showing in screen, it's subviews' window is nil, its the bug reason. Why you didn't check window != nil in UICollectionView extension? I'm not sure it is a bug or a discussion.

Can you parse why you want to check window != nil separately in UITableView extension.

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.30.4 Xcode version:13.3.1 Swift version:5.6.1

Steps to reproduce:

1.Show tableView in screen and call show skeletionView. 2.Scroll to next page then call hide skeletionView. 3.Scroll back to tableView, this skeletionView is still showing.

Expected result:

TableView's skeletionView should hide.

Actual result:

TableView's skeletionView is still showing.

Attachments:

Logs, screenshots, sample project, funny gif, etc.