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 FriendsService: FriendsWorker { | |
func fetch() -> [Friend] { | |
return [] | |
} | |
} | |
class FriendsDatabase: FriendsWorker { | |
func fetch() -> [Friend] { | |
return [] | |
} |
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
protocol FriendsWorker { | |
func fetch() -> [Friend] | |
} |
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
final class Profile { | |
private let service = FriendsService() | |
init() { | |
fetch() | |
} | |
private func fetch() { | |
service.fetch() | |
} |