0 I've been stuck on this problem for a while now and similar questions of this topic didn't help me solve this issue.

 func getData() {     DataService.instance.getUserInfo { (currentUser) in       if let currentUser = currentUser {         self!.db.collection("companies").document(currentUser.getCompany).addSnapshotListener { [weak self] (querySnapshot, error) in           guard let documents = querySnapshot?.data() else {             if let err = error {               print("NotesRepository: No company found with ID: (currentUser.getCompany)")             }             return           }           let lastUpdateDate = self!.getLastUpdateDate()             for (_, document) in querySnapshot!.documents.enumerated() {               let documentDate = document.data()["timestamp"]                               if let stamp = documentDate as? Timestamp {                 if sameDay(from: lastUpdateDate, to: NSDate(timeIntervalSince1970: TimeInterval(stamp.seconds)) as Date) {                   let notes = document.data()["notes"] as! String                   let attText = templateIt(input: notes).htmlToAttributedString                   note = Note(id: "", note_text: notes, attributedText: attText)                   break                 }               }             }           }         }       }     }

0 I've been stuck on this problem for a while now and similar questions of this topic didn't help me solve this issue.
 
 
Q