从firebase检索当前用户数据

时间:2017-06-20 01:08:42

标签: ios iphone swift xcode macos

让userId = Auth.auth()。currentUser?.uid         Database.database()。reference()。child(" Employess")。child(userId!)。observeSingleEvent(of:。value,with:{(snapshot)in

       // Get user value
       let value = snapshot.value as? NSDictionary
       //print(value)

let Name = value?["name"] as? String
        print(Name)
        // ...
        }) { (error) in

        print(error.localizedDescription)


   }

0 个答案:

没有答案