-
-
Save andreaslydemann/2b0ba75e35f847a8a45de1dd2878a3ab to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import RxSwift | |
| let disposeBag = DisposeBag() | |
| let xmenMovies = Observable.of("First Class", "Days of Future Past", "Apocalypse") | |
| let imdbRatings = Observable.of(7.7, 8.0, 7.0) | |
| Observable.combineLatest(xmenMovies, imdbRatings) { movie, rating in | |
| "\(movie) - \(rating)" | |
| } | |
| .subscribe(onNext: { | |
| print($0) | |
| }) | |
| .disposed(by: disposeBag) | |
| // Output: | |
| // First Class - 7.7 | |
| // Days of Future Past - 7.7 | |
| // Days of Future Past - 8.0 | |
| // Apocalypse - 8.0 | |
| // Apocalypse - 7.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment