devxoul / RxViewController

RxSwift wrapper for UIViewController and NSViewController
MIT License
346 stars 61 forks source link

isVisible does not always work if not subscribed immediately #13

Open PhilippeCuvillier opened 5 years ago

PhilippeCuvillier commented 5 years ago

Hello,

thank you very much for this great Pod. I think there might be an issue with UIViewController isVisible property. For instance, if this Observable is not subscribed to before the base method viewWillAppear() is invoked for the first, time, then isVisible will emit nothing instead of emitting true.

My point is that isVisible should behave like a state, not just like a combination of events: any time some observer subscribes to it, it should immediately get an event true or false. To do so, there would be two things to do:

Thank you very much, I would be pleased to know your opinion on this.

P.S. : And to go a bit further, it might be interesting to expose it as a Driver instead of an Observable.