-
-
Save Francoissss1/db970aaec63bc522e4fff6d71220d2d4 to your computer and use it in GitHub Desktop.
Download images from firebase to ios
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
override func viewWillAppear(_ animated: Bool) { | |
magsCollectionRef.getDocuments { (snapshot, error) in | |
if let err = error { | |
debugPrint("error fetching documents") | |
}else{ | |
guard let snap = snapshot else { return } | |
for document in snap.documents { | |
let data = document.data() | |
let title = data["title"] as? String ?? "no title" | |
let periodicity = data["periodicity"] as? String ?? "no periodicity" | |
let newMags = Mags(title: title, periodicity: periodicity) | |
self.mags.append(newMags) | |
} | |
self.tableView.reloadData() | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment