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

Cannot make it work with UITableView. #34

Closed
tomerciucran opened this issue Jan 25, 2018 · 3 comments
Closed

Cannot make it work with UITableView. #34

tomerciucran opened this issue Jan 25, 2018 · 3 comments

Comments

@tomerciucran
Copy link

⚠️ 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

@Juanpe
Copy link
Owner

Juanpe commented Feb 2, 2018

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

@jkmathew
Copy link

jkmathew commented Jun 12, 2018

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

@MtzDiego
Copy link

MtzDiego commented Oct 4, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants