Posting endNotificationCenter.default.post(name: Notification.Name("FishBattery"), object: tour)Receiving endNotificationCenter.default.addObserver( forName: Notification.Name("FishBattery"), object: tour, queue: OperationQueue.main) { [weak self] notification in guard let tour = notification.object as? Tour else { return } if tour == self?.tour { self?.uploadIfNeeded() } }