skip to Main Content

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

3

Answers


    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

    Login or Signup to reply.
  1. 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

    Login or Signup to reply.
  2. 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 )

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search