Created
February 26, 2022 22:38
-
-
Save mitnick78/05a460882116fc0f5937abad17f1a6de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// FirebaseManager.swift | |
// logbookLanguage | |
// | |
// Created by Christophe on 25/02/2022. | |
// | |
import Foundation | |
import Firebase | |
class FirebaseManager { | |
static let shared = FirebaseManager() | |
var auth: Auth | |
var cloudFirestore: Firestore | |
init() { | |
FirebaseApp.configure() | |
auth = Auth.auth() | |
cloudFirestore = Firestore.firestore() | |
} | |
func getId() -> String? { | |
return auth.currentUser?.uid | |
} | |
var learnsRef: CollectionReference { | |
return cloudFirestore.collection(LEARNS) | |
} | |
func getLearnByUser() -> Query { | |
return learnsRef.whereField("user_id", isEqualTo: getId()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment