Created
November 13, 2017 03:30
-
-
Save koromiko/c619cbacb3d586e7dffe59277563cf20 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
class MockApiService: APIServiceProtocol { | |
var completePhotos: [Photo] = [Photo]() // Array of stubs | |
var completeClosure: ((Bool, [Photo], APIError?) -> ()) | |
func fetchPopularPhoto(complete: @escaping (Bool, [Photo], APIError?) -> ()) { | |
\\...\\ | |
completeClosure = complete | |
} | |
func fetchSuccess() { | |
completeClosure( true, completePhotos, nil ) // Return stubs instead of empty array | |
} | |
\\....\\ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment