Created
March 14, 2023 10:13
-
-
Save tifoaudii/cb8e8afd58411f5c57045d09f56c7a1f 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
struct CardModel {} | |
protocol CardModelService { | |
func fetchCardModels(completion: @escaping (Result<[CardModel], Error>) -> Void) | |
} | |
class HomeService: CardModelService { | |
static let shared = HomeService() | |
private init() {} | |
func fetchCardModels(completion: @escaping (Result<[CardModel], Error>) -> Void) { | |
// ... | |
} | |
} | |
class CartService: CardModelService { | |
static let shared = CartService() | |
private init() {} | |
func fetchCardModels(completion: @escaping (Result<[CardModel], Error>) -> Void) { | |
// ... | |
} | |
} | |
class ProfileService: CardModelService { | |
static let shared = ProfileService() | |
private init() {} | |
func fetchCardModels(completion: @escaping (Result<[CardModel], Error>) -> Void) { | |
// ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment