Swift 3.1, Xcode 8.3.3
I have a Realm notification that gets set up in a View Controller in my app, and after my app launches, it fires 4 times in a row.
let realm = try! Realm()
notificationToken = realm.addNotificationBlock { notification, realm in
print("notif: \(notification)") <-- Logs 4 times in a split second
self.refreshData()
}
Since the refreshData()
method is what refreshes my UI (which contains a graph that gets drawn), I see a jitter/flicker as each refresh hits.
Is there a way to aggregate those notifications into a single one so I only get a single UI refresh?