Skip to content
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

Offscreen table view layout issue fixed #242

Merged
merged 2 commits into from
Feb 17, 2020
Merged

Offscreen table view layout issue fixed #242

merged 2 commits into from
Feb 17, 2020

Conversation

dmytrorykun
Copy link

  1. Run test project on iPhone 5
  2. Hide skeleton
    AR: Some table view cells remain in skeleton state.

This happens when showAnimatedSkeleton method is called from viewDidLoad before views are laid out. Table view's storyboard frame may differ from the one it receives after layout. As well as the number of its visible cells. Therefore not all "skeletoned" cells become "unskeletoned"

This PR fixes the problem

@@ -41,6 +41,11 @@ extension SkeletonCollectionDelegate: UITableViewDelegate {

return nil
}

func tableView(_ tableView: UITableView, didEndDisplaying cell: UITableViewCell, forRowAt indexPath: IndexPath) {
cell.hideSkeleton()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we need to hide the skeleton? please, give me some more info :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If table view's frame changes after showSkeleton call, then visibleCells may return fewer cells in hideSkeleton call. Then some of cells will not receive hideSkeleton and will be reused in skeleton state.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, now I understand, thanks :)

@Juanpe Juanpe changed the title Offscreen table view layout issue fixed Offscreen table view layout issue fixed Feb 13, 2020
@Juanpe Juanpe changed the base branch from master to develop February 17, 2020 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants