Skip to content

Instantly share code, notes, and snippets.

@jpcarreira
Created June 26, 2019 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpcarreira/84b69f13678d9dc35226dc3a1436c05f to your computer and use it in GitHub Desktop.
Save jpcarreira/84b69f13678d9dc35226dc3a1436c05f to your computer and use it in GitHub Desktop.
final class MockApiClient: Api {
private static let delay = 5
func fetchMovies(completion: @escaping (Bool, FilmsData?) -> Void) {
DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(MockApiClient.delay)) {
// mock your data as before, but now we have a simulated 5-second delay
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment