I'm new to using RxSwift framework, I'm actually learning and trying to understand the basics and I would like some help from you please.

```
private func observeCurrentIndex() -> Observable<Int> {
    return Observable<Int>.create { (observer) -> Disposable in
      observer.onNext(self.currentIndex)
      return Disposables.create()
    }
  }

```

Here I've created an observable on currentIndex which is an int. When I subscribe to it, I get only the first value of currentIndex which is 2. Is it not supposed to notify me whenever currentIndex changes(just like a KVO would)?

```
override func viewDidLoad() {
    super.viewDidLoad()
    observeCurrentIndex()
      .subscribe(onNext: { (valeur) in
        print("new value \(valeur)")
      })
      .addDisposableTo(disposeBag)
  }

```

To be notified each time currentIndex changes value, I've been told that I have to use a publishSubject for that.

```
@IBAction func increaseAction(_ sender: UIButton) {
    if currentIndex <= kMaxIndex {
      currentIndex = currentIndex + 1
    }
  }

```

Could someone indicate to me where and how to do this? Thanks in advance.