class User {
class func currentUserRef() -> Firebase? {
let fb = Firebase(url: "https://firebaseIO.com")
if let uid = fb.authData.uid {
// /users/<uid>
return fb.childByAppendingPath(FBUserPath).childByAppendingPath(uid)
} else {
return nil
}
}
// MARK: - Keys
static let email = "email"
static let firstName = "firstName"
static let lastName = "lastName"
static let profileImageData = "profileImageData"
}
- (NSString *)fullName{
if(self.firstName && self.lastName)
return [NSString stringWithFormat:@"%@ %@", self.firstName, self.lastName];
else if(self.firstName && !self.lastName)
return self.firstName;
else
return self.lastName;
}
UserClass
firstName
lastName
fbKeyinitFromSnapshot
getDisplayNameusers
user_id_0
firstName: David
lastName: Bowie
user_id_1
firstName: Ziggy
lastName: StardustUserClass user = [UserClass new]
[user initWithSnapshot:snapShot]return lastName + ", " + firstName //pseudo code--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/b22cd91b-4d30-4328-a8c4-6b32a90ac624%40googlegroups.com.