Last active
June 5, 2019 05:32
-
-
Save hermanbanken/7f519d95d83c95fc2fb46f27e8986182 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
| // Using RxSwift Observables | |
| let observable: Observable<Int> = Observable.create { observer in | |
| // could be anything async, e.g. a network call | |
| DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(2), execute: { | |
| observer.onNext(42) | |
| observer.onCompleted() | |
| }) | |
| return Disposables.create() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment