sergeyleschev / social-network

 Social Network in SwiftUI with MVVM (Mobile + Back). Firebase for Login/Register. @ S. Leschev. Google Engineering Level: L6+
MIT License
49 stars 8 forks source link

Argument passed to call that takes no arguments #2

Closed NasrullahKhan closed 1 month ago

NasrullahKhan commented 1 month ago
func fetchUser(withUid uid: String, completion: @escaping(User) -> Void) {
    Firestore.firestore().collection("users")
        .document(uid)
        .getDocument { snapshot, _ in
            guard let snapshot = snapshot else { return }
            var user: User

            do {
                user = try snapshot.data(as: User.self)
            } catch {
                print ("Error fetchUser: \(error)")
                return
            }

            completion(user)
        }
}

Screenshot 2024-05-17 at 11 21 08 AM

NasrullahKhan commented 1 month ago

by updating to latest firebase, the issue is solved. Thanks for your work. actually i'm swift uikit from a decade and there is lot of learning from your code about swiftui. Thanks for your amazing work