title: In RxCocoa/RxSwift, how to observe BehaviorRelay<[object]> array size changed
body: <p>I'd like to subscribe to a BehaviorRelay&lt;[object]>, and I'd like to execute some functions whenever we append or remove elements.</p>
  
  <p>I've used the distinctUntilChange method</p>
  
  <pre><code>BehaviorRelay&lt;[object]&gt;.asObservable().distinctUntilChanged{ $0.count != $1.count}.subscribe{....}
  </code></pre>
  
  <p>But didn't work. What should I try?  Should I try using other Subjects or Relays to achieve this purpose?</p>
  
  <pre><code>var objects = BehaviorRelay&lt;[Object]&gt;(value: [])
  let disposeBag = DisposeBag()
  
  objects.asObservable()
  .subscribe(onNext: { (objects) in
  //Do something only when appending or removing elements.
  }).disposed(by: disposeBag)
  
  //For example
  let tempObj = objects.value
  
  tempObj.append(newObj)
  objects.accept(tempObj)//this will be called
  
  tempObj.removeAll()
  objects.accept(tempObj)//this will be called
  
  tempObj.property = "Change Property"
  objects.accept(tempObj)//this will NOT be called
  </code></pre>