1

I build chat app using Firebase API right now. I wan't to make preload icons like on facebook screenshot. I thought i can create empty images and label fields and fill them after content loaded, but i don't know how to check if all data loaded from DB. How i can do that in correct way?

enter image description here

This is where i want to place objects

enter image description here

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
George Heints
  • 1,303
  • 3
  • 20
  • 37
  • Actually, this is template image(gif image) as like used here. https://codeburst.io/achieve-skeleton-loading-with-react-a12404678030 These templates used in tableview before loading datasource. Idea behind this : Instead of showing progress indicator, temporarily showing 3 cell with animated images alone(normally using gif) – Mani Apr 25 '18 at 06:44

3 Answers3

2
  1. Install ListPlaceholder this lib.

  2. import ListPlaceholder

To show the loader, start showing this from start

tableView.showLoader()

To hide the loader, end showing after data has been loaded

 tableView.hideLoader()

Please refer this may get help. https://github.com/malkouz/ListPlaceholder

Harsh Pipaliya
  • 2,260
  • 1
  • 14
  • 30
0

Facebook has it's own library called Shimmer. To use this on tableview, you can follow this StackOverflow question answer.

You'll just have to create the UIView you want to animate and above that you'll have to add your FBShimmeringView. At the end set shimmeringView.shimmering = true to start shimmering

Arnab
  • 4,216
  • 2
  • 28
  • 50
0

To hide the loading use tableView.hideLoader()

ListPlaceholder helped me to resolve the issue. All that I did was added the ListLoader.swift file to my project and added tableView.reloadData(), tableView.showLoader() in viewDidAppear in the tableView where I wanted to show loading. ( ListLoader.swif uses visibleCells to determine the number of rows on which the loading should be shown. In my applications, visibleCell's count was incorrect on calling tableView.showLoader() method in viewDidLoad )

benc
  • 1,381
  • 5
  • 31
  • 39
Mrunal
  • 1