-
-
Save andreaslydemann/65a191a7d1e42c0ea6b0bf5bd4822f02 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.zip(xmenMovies, imdbRatings) { movie, rating in | |
| "\(movie) - \(rating)" | |
| } | |
| .subscribe(onNext: { | |
| print($0) | |
| }) | |
| .disposed(by: disposeBag) | |
| // Output: | |
| // First Class - 7.7 | |
| // Days of Future Past - 8.0 | |
| // Apocalypse - 7.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment