You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
using a .share(replay: 1, scope: .forever) and a .startWith(false).
subscribing it internally, so that is begins immediately to listen for the viewDidAppearObservable and viewWillDisappearObservable, even if externally there are no subscribers to it. Maybe using a .publish() and .connect(), or using an internal DisposeBag property.
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.
The text was updated successfully, but these errors were encountered:
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, thenisVisible
will emit nothing instead of emittingtrue
.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 eventtrue
orfalse
.To do so, there would be two things to do:
.share(replay: 1, scope: .forever)
and a.startWith(false)
.viewDidAppearObservable
andviewWillDisappearObservable
, even if externally there are no subscribers to it. Maybe using a.publish()
and.connect()
, or using an internalDisposeBag
property.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 anObservable
.The text was updated successfully, but these errors were encountered: