Last active
January 19, 2022 16:04
-
-
Save zafarivaev/7c667d9ffe140cf19f8dd00be208a9d5 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 UIKit | |
import Combine | |
... | |
class ViewController: UIViewController { | |
... | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
overrideUserInterfaceStyle = .light | |
getAvatarFromTheServer() | |
.handleEvents(...) | |
// | |
.delay(for: 1, scheduler: DispatchQueue.global()) | |
// | |
.retry(3) | |
.receive(on: DispatchQueue.main) | |
.sink(...) | |
.store(in: &cancellables) | |
} | |
private func getAvatarFromTheServer() -> AnyPublisher<UIImage, Error> { | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment