title: How to observe objects count on realm db
body: <p>I want to observe the object count of the realm DB.
  I wrote this approach:</p>
  
  <pre><code>let realm = try? Realm()
  self.notificationToken = realm?.objects(AnalyticsEventDto.self).observe { _ in
      if let count = realm?.objects(AnalyticsEventDto.self).count {
          observer.send(value: count)
      }
  }
  </code></pre>
  
  <p>There is another way to do so?
  Thanks</p>