SkeletonView
SkeletonView copied to clipboard
Cannot make it work with UITableView.
⚠️ Please fill out this template when filing an issue.
What did you do?
- import SkeletonView
- conform to 'SkeletonTableViewDataSource' and return cell identifier.
- tableView.isSkeletonable = true
- 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
Hi @tomerciucran, the problem has been fixed in version 1.0.5
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
i have the same issue and i have the new version 1.4.1