Polishing the home screen

We have the UI developed and we won't add any new visual elements. Each cell contains an avatar image and an avatar name. Our only task is to fetch all user profiles and load the information in each cell. This is not a trivial task. We will use a dictionary to store the profiles of all the different users. Then, we can start the loading and, once we have all the profiles, we can refresh UIViewCollection:

var users = [String: UserModel?]()

This is the only new property which we will add to HomeFeedViewController. Then we have to add a new model to the DataManager.swiftUserModel:

class UserModel {    var avatarPhoto:String?    var username:String?            init() {        //nothing    }             init?(snapshot:DataSnapshot) { if let dict = snapshot.value ...

Get Learn Swift by Building Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.