Created
March 27, 2017 16:57
-
-
Save JohnSundell/25368861c638eee7989c9d7d9100aaaf to your computer and use it in GitHub Desktop.
Code sample #8 from https://medium.com/@johnsundell/type-erasure-using-closures-in-swift-1e6125231f8
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
override func viewWillAppear(_ animated: Bool) { | |
super.viewWillAppear(animated) | |
loadModel { result in | |
switch result { | |
case .success(let model): | |
render(model) | |
case .error(let error): | |
render(error) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment