Last active
June 18, 2019 08:49
-
-
Save deda9/e71033e663dea21a6908e62539df5d62 to your computer and use it in GitHub Desktop.
Create RxObservable with range
This file contains 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
func createRxObservable() { | |
let source: Observable<Int> = Observable.range(start: 3, count: 3) | |
source | |
.subscribe(onNext: { number in | |
print("Current emitted number: ", number) | |
}, onError: { _ in print("On Error") }, | |
onCompleted: { print("Complete") }, | |
onDisposed: nil) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment