Last active
April 14, 2017 11:07
-
-
Save fadion/dd010e3984d33211b7a493089ce54732 to your computer and use it in GitHub Desktop.
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 fillWithData() { | |
PizzaManager().all() | |
.subscribe(onNext: { [weak self] pizza in | |
self?.pizzaViewModel.value = pizza | |
}, onError: { [weak self] _ in | |
if self?.pizzaViewModel.value.count == 0 { | |
self?.pizzaCollectionView.backgroundView = NetworkErrorView(withAction: { | |
self?.fillWithData() | |
}) | |
} | |
}).disposed(by: self.disposeBag) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment