I have a variable that is an array of enum values. These values change over time.
enum Option { case One case Two case Three } let options = Variable<[Option]>([ .One, .Two, .Three ])
Then I observe this variable for changes. The problem is that I need to know the difference between the newest value and the previous value. I am doing this now:
let previousOptions: [Option] = [ .One, .Two, .Three ] ... options .asObservable() .subscribeNext { [unowned self] opts in
Is there something built into RxSwift that can handle this better? Is there a way to always get previous and current values from a signal?
source share