I have this piece of code:
let appActiveNotifications: [Observable<NSNotification>] = [
NSNotificationCenter.defaultCenter().rx_notification(UIApplicationWillEnterForegroundNotification),
NSNotificationCenter.defaultCenter().rx_notification(Constants.AppRuntimeCallIncomingNotification)
]
appActiveNotifications.merge()
.takeUntil(self.rx_deallocated)
.subscribeNext() { [weak self] _ in
// notification handling
}
.addDisposableTo(disposeBag)
It's supposed to listen to either of the specified notifications and handle when any of them is triggered.
However this does not compile. I get the following error:
Value of type '[Observable<NSNotification>]' has no member 'merge'
How should I merge these two signals to one then?