mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-27 04:14:21 +00:00
Use ValueObservation.tracking(value:) in demo app
This commit is contained in:
1 parent
c734eba245
commit
eea8f7b1e9
1 file changed
+4
-1
@@ -71,7 +71,10 @@ class PlayersViewController: UITableViewController {
|
||||
|
||||
private func configureTitle() {
|
||||
// Track changes in the number of players
|
||||
playerCountObserver = playersRequest.observationForCount().start(
|
||||
let observation = ValueObservation.tracking { db in
|
||||
try Player.fetchCount(db)
|
||||
}
|
||||
playerCountObserver = observation.start(
|
||||
in: dbQueue,
|
||||
onError: { error in
|
||||
fatalError("Unexpected error: \(error)")
|
||||
|
||||
Reference in new issue
Block a user