Skip to content

Skeleton in tableView with different cells (HEIGHTS) #591

@Leamsi-Alvarado

Description

@Leamsi-Alvarado

Description

Skeleton in tableView with different cells (HEIGHTS)

What type of issue is this? (place an x in one of the [ ])

  • bug
  • enhancement (feature request)
  • [] question
  • documentation related
  • discussion

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

SkeletonView Environment:

SkeletonView version:1.30.4
Xcode version:16.2
Swift version:6.0.3

Steps to reproduce:

  1. Create a tableView with different cells, inside the the cellForRowAt using:
    let emptyCell = UITableViewCell()
    let section = homeSections[indexPath.section].cellType
  2. Using the extension for collectionSkeletonView cellIdentifierForRowAt:
    if indexPath.row == 0 {
    return IntroHomeTableViewCell.identifier
    }else{
    return ProductsTableViewCell.identifier
    }
  3. Using extension for SkeletonTableViewDelegate and using the function collectionSkeletonView(heightForRowAt)
    if indexPath.row == 0 {
    return 220
    }else{
    return 270
    }

Expected result:

My goal right now is to have the tableView with the two diferent cells, the first cell (IntroHomeTableViewCell) as 220 height, and the second cell (ProductsTableViewCell) as 270 height

Actual result:

I'm getting two different cells indeed which is part of the objective, but the second cell (ProductsTableViewCell) is setted as 220 height, which means it is a copy of height from the first cell

Attachments:

I will set here how the ProductsTableviewcell should look with all the corners perfectly rounded in other view.

*Other view with the 270 height ->

Image

Here is what happens when i use this function:
extension HomeViewController: SkeletonTableViewDelegate {
func collectionSkeletonView(_ skeletonView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.row == 0 {
return 220
}else{
return 270
}
}
} ->>
Image

*Here is what happens when i dont use the function of height, as you can see the first cell is correct, but the second one is like cutted (because the height should be 270).

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions