I'm trying to emit a sequence on a ”pulse” at a given time interval. Totally new to everything Rx, but thought this would do it:
import RxSwift
let db = DisposeBag()
_ = Observable<Int>.interval(1.0, scheduler: MainScheduler.instance)
.debug("interval")
.subscribe(onNext: {
print($0)
})
.addDisposableTo(db)
But it only outputs:
2017-09-25 06:12:41.161: interval -> subscribed
And nothing more. What am I not understanding here?
db? Try again without this line:.addDisposableTo(db)- Nikita Ermolenko.addDisposableit stil doesn't seem to emit anything. I've added the complete code in my playground now. The dispose bag should be alive. - PEZpod 'RxSwift', '~> 3.0'- PEZ