Created
December 10, 2019 20:55
-
-
Save dmytro-anokhin/4987f25af807edacc3b1b439628bdbe7 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
protocol UserNetworkService { | |
func loadUsers(withURL url: URL, completion: @escaping (Result<[User], Error>) -> Void) | |
} | |
class UserService { | |
let networkService: UserNetworkService | |
init(networkService: UserNetworkService) { | |
self.networkService = networkService | |
} | |
func getUser(withId userId: Int, completion: @escaping (User?) -> Void) { | |
// ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment