Dependency injection and Generics to create a modular app in Swift
['Benoit Pasquier']
Benoit Pasquier - Swift, Data and more
key ) " ) } } // LoginUI import Analytics public class LoginViewController : UIViewController { let eventHandler : EventHandlerProtocol public init ( eventHandler : EventHandlerProtocol ) { self . { get } } public protocol EventHandlerProtocol { func send < T : EventProtocol >( _ event : T ) } public class EventHandler : EventHandlerProtocol { public init () { } public func send < T : EventProtocol >( _ event : T ) { // TODO private implementation print ( "SEND - \( event .