Advertisement
Guest User

Untitled

a guest
Jul 8th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. class FirebaseManager: NSObject {
  2. static let databbaseRef = Database.database().reference()
  3. static var currentUserId:String = ""
  4. static var currentUser:User?
  5.  
  6. static func Login(email:String, password:String, completion: @escaping (_ success:Bool) -> Void) {
  7. Auth.auth().signIn(withEmail: email, password: password, completion: { (user,error) in
  8. if let error = error {
  9. print(error.localizedDescription)
  10. completion(false)
  11. } else {
  12. currentUser = user
  13. currentUserId = (user?.uid)!
  14. completion(true) }
  15.  
  16. static var currentUser:User?
  17.  
  18. static var currentUser: FirebaseAuth.User?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement