Skip to content

Instantly share code, notes, and snippets.

View evgenmikhaylov's full-sized avatar

Evgeny Mikhaylov evgenmikhaylov

  • Revolut
  • Porto, Portugal
View GitHub Profile
@artemnovichkov
artemnovichkov / ServicesComposition.swift
Last active May 4, 2018 07:17
Using protocol composition and generics for dependency injection in Interactors (VIPER, SOA, another cool keywords...)
//Inspired by: http://merowing.info/2017/04/using-protocol-compositon-for-dependency-injection/
//Protocols for objects owning services. Interactors in VIPER, for example.
protocol HasLogService {
var logService: LogService { get }
}
protocol HasLoginService {
var loginService: LoginService { get }
}