SkeletonView icon indicating copy to clipboard operation
SkeletonView copied to clipboard

Cannot make it work with UITableView.

Open tomerciucran opened this issue 8 years ago • 3 comments

⚠️ Please fill out this template when filing an issue.

What did you do?

  1. import SkeletonView
  2. conform to 'SkeletonTableViewDataSource' and return cell identifier.
  3. tableView.isSkeletonable = true
  4. tableView.showSkeleton() before loading and tableView.hideSkeleton() after data is received.

What did you expect to happen?

To see a template of the provided cell while the data is being loaded.

What happened instead?

The whole table had a gray overlay view and it disappeared after the data was received.

SkeletonView Environment

**SkeletonView version: 1.0.4 **Xcode version: 9.2 **Swift version: 4

tomerciucran avatar Jan 25 '18 11:01 tomerciucran

Hi @tomerciucran, the problem has been fixed in version 1.0.5

Juanpe avatar Feb 02 '18 17:02 Juanpe

I have same issue, I am Using SkeletonView (1.1.1) Adding my code below

override func viewDidLoad() {
        super.viewDidLoad()
       
        tableView.estimatedRowHeight = 110
        tableView.rowHeight = UITableViewAutomaticDimension
        
        tableView.isSkeletonable = true
        tableView.showSkeleton()
        DispatchQueue.main.asyncAfter(deadline: .now() + 5) {
            self.isLoading = false
            self.tableView.hideSkeleton()
            self.tableView.reloadData()
            print("completed")
        }
    }

extension SecondViewController: SkeletonTableViewDataSource {
    
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 10
    }
    
    func collectionSkeletonView(_ skeletonView: UITableView, cellIdenfierForRowAt indexPath: IndexPath) -> ReusableCellIdentifier {
        return "Cell"
    }
    
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! InfoCell
        let name = "kingfisher-\(indexPath.row).jpg"
        let url = URL(string: "https://raw.githubusercontent.com/onevcat/Kingfisher/master/images/\(name)")!
        cell.label.text = name
        cell.thumbView.kf.setImage(with: url)
        return cell
    }
}

I set only tableView as isSkeletonable = true. All other views remains default

jkmathew avatar Jun 12 '18 16:06 jkmathew

i have the same issue and i have the new version 1.4.1

MtzDiego avatar Oct 04 '18 17:10 MtzDiego