Slide 29
Slide 29 text
!ZPJDIJUHZ
Example of class
definition with
typealias of tuple
protocol APIClientProtocol { ... }
class APIClient: APIClientProtocol { ... }
protocol LoggerProtocol { ... }
class Logger: LoggerProtocol { ... }
5ZQFBMJBTPG
EFQFOEFODZUVQMF
class MyViewModel {
typealias Dependency = (
APIClientProtocol,
LoggerProtocol
)
let (apiClient, logger): Dependency
let id: String
init(dependency: Dependency, id: String) {
(apiClient, logger) = dependency
self.id = id
}
}
&YBNQMFXJUIEFQFOEFODJFTBOEQBSBNFUFS