Wednesday, January 11, 2023
HomeiOS DevelopmentContextual closure kind '(DataSnapshot, String?) -> Void' expects 2 arguments, however 1...

Contextual closure kind ‘(DataSnapshot, String?) -> Void’ expects 2 arguments, however 1 was utilized in closure physique


I’m model new to coding and following a course. I’m not positive why this error retains occurring. I’ve doubled the whole lot listed within the course movies nevertheless it nonetheless appears to create the error.

I attempted rewriting the code a number of occasions. I additionally tried "fixing" with the instructed problem with arg however the teacher doesn’t have to do this within the course and I’m simply questioning the place I went flawed.

the realm comes on the REF line.


import Firebase

let DB_REF = Database.database().reference()
let REF_USERS = DB_REF.little one("customers")

struct Service {
    
    static let shared = Service()
    
    let currentUid = Auth.auth().currentUser?.uid
    
    func fetchUserData(completion: @escaping(Consumer) -> Void) {
        REF_USERS.little one(currentUid!).observeSingleEvent(of: .worth) { (snapshot) in
            guard let dictionary = snapshot.worth as? [String: Any] else { return }
            guard let fullname = dictionary("fullname") as? String else { return }
            let person = Consumer(dictionary: dictionary)
            
            print("DEBUG: Consumer e mail is (person.e mail)")
            print("DEBUG: Consumer fullname is (person.fullname)")
            
            completion(person)



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments